lean into examples

This commit is contained in:
Mark McGranaghan
2012-10-09 21:02:12 -07:00
parent 5d1775bdaa
commit 8daa226a48
130 changed files with 4 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
package main
import "fmt"
type Circle struct {
x, y, r float64
}
func main() {
cEmptyPtr := new(Circle)
fmt.Println(cEmptyPtr)
fmt.Println(*cEmptyPtr)
cValue := Circle{x: 1, y: 2, r: 5}
fmt.Println(&cValue)
fmt.Println(cValue)
cOrdered := Circle{1, 2, 5}
fmt.Println(cOrdered)
}
// todo: add field access