Go struct
2019-03-05 本文已影响0人
JaedenKil
package main
import "fmt"
func main() {
v := Vertex{5, 2}
fmt.Println(v.X)
fmt.Println(v.Y)
}
type Vertex struct {
X int
Y int
}
Outputs:
5
2
package main
import "fmt"
func main() {
v := Vertex{5, 2}
fmt.Println(v.X)
fmt.Println(v.Y)
}
type Vertex struct {
X int
Y int
}
Outputs:
5
2