Source file tour/moretypes/maps.go

     1  //go:build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  type Vertex struct {
     8  	Lat, Long float64
     9  }
    10  
    11  var m map[string]Vertex
    12  
    13  func main() {
    14  	m = make(map[string]Vertex)
    15  	m["Bell Labs"] = Vertex{
    16  		40.68433, -74.39967,
    17  	}
    18  	fmt.Println(m["Bell Labs"])
    19  }
    20  

View as plain text