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,20 @@
package main
import "fmt"
type Point struct {
x, y int
}
func main() {
point := Point{1, 2}
fmt.Printf("default: %v\n", point)
fmt.Printf("default w/ vals: %+v\n", point)
fmt.Printf("go: %#v\n", point)
fmt.Printf("go type: %T\n", point)
fmt.Printf("boolean: %t\n", true)
}
// todo: the rest

View File

@@ -0,0 +1,6 @@
$ go run string-formatting.go
default: {1 2}
default w/ vals: {x:1 y:2}
go: main.Point{x:1, y:2}
go type: main.Point
boolean: true