diff options
| author | Andrew Gerrand <adg@golang.org> | 2016-06-21 10:46:23 +1000 |
|---|---|---|
| committer | Andrew Gerrand <adg@golang.org> | 2016-06-21 01:17:15 +0000 |
| commit | 4044bee91eb5f9318337ee5d7270efc441a5338a (patch) | |
| tree | edf0e459e5d7c82961be5145843e4fed01c6c4a6 | |
| parent | 7671a9e74951049581e540e5641503e2c0ef8943 (diff) | |
| download | golang-id-tour-4044bee91eb5f9318337ee5d7270efc441a5338a.tar.xz | |
content: simplify introduction of basic types
The use of the constant format string is confusing here.
Fixes golang/tour#38
Change-Id: I6ebac4effbb1c8ac50805bc7e24f691bb0c233b9
Reviewed-on: https://go-review.googlesource.com/24290
Reviewed-by: Francesc Campoy Flores <campoy@golang.org>
| -rw-r--r-- | content/basics/basic-types.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/content/basics/basic-types.go b/content/basics/basic-types.go index 25fd48e..99becee 100644 --- a/content/basics/basic-types.go +++ b/content/basics/basic-types.go @@ -14,8 +14,7 @@ var ( ) func main() { - const f = "%T(%v)\n" - fmt.Printf(f, ToBe, ToBe) - fmt.Printf(f, MaxInt, MaxInt) - fmt.Printf(f, z, z) + fmt.Printf("Type: %T Value: %v\n", ToBe, ToBe) + fmt.Printf("Type: %T Value: %v\n", MaxInt, MaxInt) + fmt.Printf("Type: %T Value: %v\n", z, z) } |
