type PathElementValueMap … func MakePathElementValueMap(size int) PathElementValueMap { … } type sortedPathElementValues … // Implement the sort interface; this would permit bulk creation, which would // be faster than doing it one at a time via Insert. func (spev sortedPathElementValues) Len() int { … } func (spev sortedPathElementValues) Less(i, j int) bool { … } func (spev sortedPathElementValues) Swap(i, j int) { … } // Insert adds the pathelement and associated value in the map. // If insert is called twice with the same PathElement, the value is replaced. func (s *PathElementValueMap) Insert(pe PathElement, v value.Value) { … } // Get retrieves the value associated with the given PathElement from the map. // (nil, false) is returned if there is no such PathElement. func (s *PathElementValueMap) Get(pe PathElement) (value.Value, bool) { … } type PathElementMap … type pathElementValue … func MakePathElementMap(size int) PathElementMap { … } // Insert adds the pathelement and associated value in the map. // If insert is called twice with the same PathElement, the value is replaced. func (s *PathElementMap) Insert(pe PathElement, v interface{ … } // Get retrieves the value associated with the given PathElement from the map. // (nil, false) is returned if there is no such PathElement. func (s *PathElementMap) Get(pe PathElement) (interface{ … }