24 var ( -25 Stdin = newFile(0, "/dev/stdin") -26 Stdout = newFile(1, "/dev/stdout") -27 Stderr = newFile(2, "/dev/stderr") +25 Stdin = newFile(syscall.Stdin, "/dev/stdin") +26 Stdout = newFile(syscall.Stdout, "/dev/stdout") +27 Stderr = newFile(syscall.Stderr, "/dev/stderr") 28 )
@@ -663,7 +663,7 @@ something from the directory of installed packages.
(Also, ''file.go
'' must be compiled before we can import the
package.)
-Now we can compile and run the program: +Now we can compile and run the program. On Unix, this would be the result:
$ 6g file.go # compile file package diff --git a/doc/progs/file.go b/doc/progs/file.go index d3fb5ae9e82..df3a3cf71c8 100644 --- a/doc/progs/file.go +++ b/doc/progs/file.go @@ -22,9 +22,9 @@ func newFile(fd int, name string) *File { } var ( - Stdin = newFile(0, "/dev/stdin") - Stdout = newFile(1, "/dev/stdout") - Stderr = newFile(2, "/dev/stderr") + Stdin = newFile(syscall.Stdin, "/dev/stdin") + Stdout = newFile(syscall.Stdout, "/dev/stdout") + Stderr = newFile(syscall.Stderr, "/dev/stderr") ) func Open(name string, mode int, perm uint32) (file *File, err os.Error) {