type uniqueBox … type spatialHashMap … func (s *spatialHashMap) TestCollision(b *Box, test func(a *Box, b *Box) bool) (bool, int) { … } func (s *spatialHashMap) Add(b *Box) { … } func newSpatialHashMap(windowWidth float64, windowHeight float64, gridSize int) *spatialHashMap { … } func minsize(a int, b int) int { … } func (s *spatialHashMap) toGridCoords(b *Box) (int, int, int, int) { … }