gobyexample/045-string-formatting/string-formatting.go
Mark McGranaghan e4b083d49b index work
2012-09-23 17:45:04 -07:00

23 lines
350 B
Go

// ## 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