Source file tour/moretypes/map-literals.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  	"Bell Labs": Vertex{
    13  		40.68433, -74.39967,
    14  	},
    15  	"Google": Vertex{
    16  		37.42202, -122.08408,
    17  	},
    18  }
    19  
    20  func main() {
    21  	fmt.Println(m)
    22  }
    23  

View as plain text