Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1742)

Side by Side Diff: doc/progs/print_string.go

Issue 179063: code review 179063: update tutorial. (Closed)
Patch Set: code review 179063: update tutorial. Created 15 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « doc/progs/print.go ('k') | doc/progs/server.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import "fmt" 7 import "fmt"
8 8
9 type testType struct { a int; b string } 9 type testType struct {
10 » a int
11 » b string
12 }
10 13
11 func (t *testType) String() string { 14 func (t *testType) String() string {
12 return fmt.Sprint(t.a) + " " + t.b 15 return fmt.Sprint(t.a) + " " + t.b
13 } 16 }
14 17
15 func main() { 18 func main() {
16 » t := &testType{77, "Sunset Strip"}; 19 » t := &testType{77, "Sunset Strip"}
17 fmt.Println(t) 20 fmt.Println(t)
18 } 21 }
OLDNEW
« no previous file with comments | « doc/progs/print.go ('k') | doc/progs/server.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b