gobyexample/030-fields.go
Mark McGranaghan 354a9d862f reorder
2012-09-21 07:54:20 -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)
}