diff options
author | Rob Pike <r@golang.org> | 2009-01-09 15:16:31 -0800 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-01-09 15:16:31 -0800 |
commit | bc23ce679061b8f41f551578181b9feeb24f5c0a (patch) | |
tree | 64f4931996e82c6dff92d3c7647814b7c43469b3 /doc/progs/helloworld3.go | |
parent | 0509e08028f63b53b65f294e06d603ccfdb76c22 (diff) | |
download | golang-bc23ce679061b8f41f551578181b9feeb24f5c0a.tar.gz |
update tutorial to new language.
add a section on printing
add a section on allocation
R=rsc
DELTA=500 (278 added, 15 deleted, 207 changed)
OCL=22381
CL=22456
Diffstat (limited to 'doc/progs/helloworld3.go')
-rw-r--r-- | doc/progs/helloworld3.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/progs/helloworld3.go b/doc/progs/helloworld3.go index f282bcefb..f6decccbf 100644 --- a/doc/progs/helloworld3.go +++ b/doc/progs/helloworld3.go @@ -4,14 +4,14 @@ package main -import FD "fd" +import fd "fd" func main() { hello := []byte{'h', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '\n'}; - FD.Stdout.Write(hello); - fd, errno := FD.Open("/does/not/exist", 0, 0); - if fd == nil { - print("can't open file; errno=", errno, "\n"); + fd.Stdout.Write(hello); + file, err := fd.Open("/does/not/exist", 0, 0); + if file == nil { + print("can't open file; err=", err.String(), "\n"); sys.exit(1); } } |