gobyexample/32-fields.go
Mark McGranaghan f497e342f2 more
2012-09-16 14:53:41 -07:00

16 lines
187 B
Go

package main
import "fmt"
type Circle struct {
x, y, r int
}
func main() {
c := Circle{x: 1, y: 2, r: 5}
fmt.Println(c.x, c.y, c.r)
c.x = 10
c.y = 5
fmt.Println(c.x, c.y, c.r)
}