diff options
author | Rob Pike <r@golang.org> | 2009-03-18 14:09:16 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-03-18 14:09:16 -0700 |
commit | b2dc154421eb830c812e089b2b69a0c728704b5b (patch) | |
tree | d1599c2c8816a88bd3673cb13cab4d3f1c8e6e45 /doc/progs/helloworld3.go | |
parent | 0bacb74554806871b8d354ed9f07163989bb8755 (diff) | |
download | golang-b2dc154421eb830c812e089b2b69a0c728704b5b.tar.gz |
remove print() from the tutorial, generating a little clumsiness around "import"
R=rsc,gri
DELTA=103 (36 added, 33 deleted, 34 changed)
OCL=26442
CL=26491
Diffstat (limited to 'doc/progs/helloworld3.go')
-rw-r--r-- | doc/progs/helloworld3.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/progs/helloworld3.go b/doc/progs/helloworld3.go index 18fa594f0..630c49232 100644 --- a/doc/progs/helloworld3.go +++ b/doc/progs/helloworld3.go @@ -4,14 +4,17 @@ package main -import file "file" +import ( + "file"; + "fmt"; +) func main() { hello := []byte{'h', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '\n'}; file.Stdout.Write(hello); file, err := file.Open("/does/not/exist", 0, 0); if file == nil { - print("can't open file; err=", err.String(), "\n"); + fmt.Printf("can't open file; err=%s\n", err.String()); sys.Exit(1); } } |