You can just use coords.World as a map key directly, no need to make a hash function. Go allows any type with well-defined == and != operators to be used as a map key directly, see http://golang.org/ref/spec#Map_types for details.