You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: item_types_loader.go
    path of file: ./repos/OpenDiablo2/d2core/d2records
    
    the code of the file until where you have to start completion: package d2records

import (
	"log"

	"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
	"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
)

// LoadItemTypes loads ItemType records
func itemTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error {
	records := make(ItemTypes)

	charCodeMap := map[string]d2enum.Hero{
		"ama": d2enum.HeroAmazon,
		"ass": d2enum.HeroAssassin,
		"bar": d2enum.HeroBarbarian,
		"dru": d2enum.HeroDruid,
		"nec": d2enum.HeroNecromancer,
		"pal": d2enum.HeroPaladin,
		"sor": d2enum.HeroSorceress,
	}

	for d.Next() {
	
    
func LoadItemEquivalencies(allItems CommonItems, allTypes ItemTypes) ItemEquivalenceMap {
	equivMap := make(ItemEquivalenceMap)

	for typeCode := range allTypes {
		code := []string{
			typeCode,
			allTypes[typeCode].Equiv1,
			allTypes[typeCode].Equiv2,
		}

		for _, str := range code {
			if str == "" {
				continue
			}

			if equivMap[str] == nil {
				equivMap[str] = make([]*ItemCommonRecord, 0)
			}
		}
	}

	for icrCode := range allItems {
		commonItem := allItems[icrCode]
		updateEquivalencies(allTypes, equivMap, commonItem, allTypes[commonItem.Type], nil)

		if commonItem.Type2 != "" { // some items (like gems) have a secondary type
			updateEquivalencies(allTypes, equivMap, commonItem, allTypes[commonItem.Type2], nil)
		}
	}

	return equivMap
}