mirror of
https://github.com/golang/go
synced 2024-11-21 14:54:40 -07:00
tutorial: a couple of minor fixes.
Fixes #1333. R=rsc, gri CC=golang-dev https://golang.org/cl/3556041
This commit is contained in:
parent
27f2d5ce8c
commit
e3b6188ca2
@ -649,8 +649,8 @@ We can now use our new package:
|
|||||||
13 func main() {
|
13 func main() {
|
||||||
14 hello := []byte("hello, world\n")
|
14 hello := []byte("hello, world\n")
|
||||||
15 file.Stdout.Write(hello)
|
15 file.Stdout.Write(hello)
|
||||||
16 file, err := file.Open("/does/not/exist", 0, 0)
|
16 f, err := file.Open("/does/not/exist", 0, 0)
|
||||||
17 if file == nil {
|
17 if f == nil {
|
||||||
18 fmt.Printf("can't open file; err=%s\n", err.String())
|
18 fmt.Printf("can't open file; err=%s\n", err.String())
|
||||||
19 os.Exit(1)
|
19 os.Exit(1)
|
||||||
20 }
|
20 }
|
||||||
|
@ -13,8 +13,8 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
hello := []byte("hello, world\n")
|
hello := []byte("hello, world\n")
|
||||||
file.Stdout.Write(hello)
|
file.Stdout.Write(hello)
|
||||||
file, err := file.Open("/does/not/exist", 0, 0)
|
f, err := file.Open("/does/not/exist", 0, 0)
|
||||||
if file == nil {
|
if f == nil {
|
||||||
fmt.Printf("can't open file; err=%s\n", err.String())
|
fmt.Printf("can't open file; err=%s\n", err.String())
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"./sort"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ints() {
|
func ints() {
|
||||||
|
Loading…
Reference in New Issue
Block a user