A struct
is a collection of fields.
(And a type
declaration does what you‘d expect.)
package main import "fmt" type Vertext struct { X int Y int } func main() { fmt.Println(Vertext{1,2}) }
时间: 2024-10-11 04:37:33
A struct
is a collection of fields.
(And a type
declaration does what you‘d expect.)
package main import "fmt" type Vertext struct { X int Y int } func main() { fmt.Println(Vertext{1,2}) }