首页 > 代码库 > A Tour of Go Structs

A Tour of Go Structs

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})}

 

A Tour of Go Structs