diff options
author | Russ Cox <rsc@golang.org> | 2009-05-08 15:21:41 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-05-08 15:21:41 -0700 |
commit | 1ea895d9a458c9e4a91993924fcd39ce7f1dcabe (patch) | |
tree | 5b8c80c41b4110b57cef1a0945350c2caf7557e2 /doc/progs | |
parent | 206ea17d5fe6ad6d6492afe73ec2d72ce399a3fd (diff) | |
download | golang-1ea895d9a458c9e4a91993924fcd39ce7f1dcabe.tar.gz |
move things out of sys into os and runtime
R=r
OCL=28569
CL=28573
Diffstat (limited to 'doc/progs')
-rw-r--r-- | doc/progs/cat.go | 4 | ||||
-rw-r--r-- | doc/progs/cat_rot13.go | 4 | ||||
-rw-r--r-- | doc/progs/helloworld3.go | 3 | ||||
-rw-r--r-- | doc/progs/strings.go | 3 |
4 files changed, 8 insertions, 6 deletions
diff --git a/doc/progs/cat.go b/doc/progs/cat.go index 1f6c0f9df..f0f534926 100644 --- a/doc/progs/cat.go +++ b/doc/progs/cat.go @@ -18,7 +18,7 @@ func cat(f *file.File) { switch nr, er := f.Read(&buf); true { case nr < 0: fmt.Fprintf(os.Stderr, "error reading from %s: %s\n", f.String(), er.String()); - sys.Exit(1); + os.Exit(1); case nr == 0: // EOF return; case nr > 0: @@ -38,7 +38,7 @@ func main() { f, err := file.Open(flag.Arg(i), 0, 0); if f == nil { fmt.Fprintf(os.Stderr, "can't open %s: error %s\n", flag.Arg(i), err); - sys.Exit(1); + os.Exit(1); } cat(f); f.Close(); diff --git a/doc/progs/cat_rot13.go b/doc/progs/cat_rot13.go index 7411a7bed..931fdf03c 100644 --- a/doc/progs/cat_rot13.go +++ b/doc/progs/cat_rot13.go @@ -60,7 +60,7 @@ func cat(r reader) { switch nr, er := r.Read(&buf); { case nr < 0: fmt.Fprintf(os.Stderr, "error reading from %s: %s\n", r.String(), er.String()); - sys.Exit(1); + os.Exit(1); case nr == 0: // EOF return; case nr > 0: @@ -81,7 +81,7 @@ func main() { f, err := file.Open(flag.Arg(i), 0, 0); if f == nil { fmt.Fprintf(os.Stderr, "can't open %s: error %s\n", flag.Arg(i), err); - sys.Exit(1); + os.Exit(1); } cat(f); f.Close(); diff --git a/doc/progs/helloworld3.go b/doc/progs/helloworld3.go index 630c49232..01fc3e30a 100644 --- a/doc/progs/helloworld3.go +++ b/doc/progs/helloworld3.go @@ -7,6 +7,7 @@ package main import ( "file"; "fmt"; + "os"; ) func main() { @@ -15,6 +16,6 @@ func main() { file, err := file.Open("/does/not/exist", 0, 0); if file == nil { fmt.Printf("can't open file; err=%s\n", err.String()); - sys.Exit(1); + os.Exit(1); } } diff --git a/doc/progs/strings.go b/doc/progs/strings.go index ee2596d8f..2c4937e38 100644 --- a/doc/progs/strings.go +++ b/doc/progs/strings.go @@ -5,10 +5,11 @@ package main import "fmt" +import "os" func main() { s := "hello"; - if s[1] != 'e' { sys.Exit(1) } + if s[1] != 'e' { os.Exit(1) } s = "good bye"; var p *string = &s; *p = "ciao"; |