]> Cypherpunks repositories - gostls13.git/commitdiff
tutorial: a couple of minor fixes.
authorRob Pike <r@golang.org>
Thu, 9 Dec 2010 21:18:31 +0000 (16:18 -0500)
committerRob Pike <r@golang.org>
Thu, 9 Dec 2010 21:18:31 +0000 (16:18 -0500)
Fixes #1333.

R=rsc, gri
CC=golang-dev
https://golang.org/cl/3556041

doc/go_tutorial.html
doc/progs/helloworld3.go
doc/progs/sortmain.go

index 1b9f752443082afd2c4374d698482cb75750ad6f..11e9b4ad777e11f10d0e53fabab7172fbc99ced3 100644 (file)
@@ -649,8 +649,8 @@ We can now use our new package:
 13    func main() {
 14        hello := []byte(&quot;hello, world\n&quot;)
 15        file.Stdout.Write(hello)
-16        file, err := file.Open(&quot;/does/not/exist&quot;,  0,  0)
-17        if file == nil {
+16        f, err := file.Open(&quot;/does/not/exist&quot;,  0,  0)
+17        if f == nil {
 18            fmt.Printf(&quot;can't open file; err=%s\n&quot;,  err.String())
 19            os.Exit(1)
 20        }
index e065f02e6bf2e13817f7dca45523e06c66189b7a..adbcea3247bbe7c798a93b39fc4cd9f8d44996b9 100644 (file)
@@ -13,8 +13,8 @@ import (
 func main() {
        hello := []byte("hello, world\n")
        file.Stdout.Write(hello)
-       file, err := file.Open("/does/not/exist",  0,  0)
-       if file == nil {
+       f, err := file.Open("/does/not/exist",  0,  0)
+       if f == nil {
                fmt.Printf("can't open file; err=%s\n",  err.String())
                os.Exit(1)
        }
index 6bd504a5b818ea7992549c3ec2993604db112366..a77ae7381af1680f2e2eb913cad18eb6848e1296 100644 (file)
@@ -6,7 +6,7 @@ package main
 
 import (
        "fmt"
-       "sort"
+       "./sort"
 )
 
 func ints() {