Structs

A struct is a collection of fields.

structs.go

  1. package main
  2. import "fmt"
  3. type Vertex struct {
  4. X int
  5. Y int
  6. }
  7. func main() {
  8. fmt.Println(Vertex{1, 2})
  9. }