diff options
Diffstat (limited to 'doc/progs/print_string.go')
-rw-r--r-- | doc/progs/print_string.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/progs/print_string.go b/doc/progs/print_string.go index 13a8d8241..7526f79fb 100644 --- a/doc/progs/print_string.go +++ b/doc/progs/print_string.go @@ -6,13 +6,16 @@ package main import "fmt" -type testType struct { a int; b string } +type testType struct { + a int; + b string; +} func (t *testType) String() string { - return fmt.Sprint(t.a) + " " + t.b + return fmt.Sprint(t.a) + " " + t.b; } func main() { t := &testType{77, "Sunset Strip"}; - fmt.Println(t) + fmt.Println(t); } |