more index work

This commit is contained in:
Mark McGranaghan
2012-09-23 14:38:39 -07:00
parent 3474d39dc5
commit c19a29193e
112 changed files with 8 additions and 39 deletions

View File

@@ -0,0 +1,22 @@
// ## String Formatting
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