summaryrefslogtreecommitdiff
path: root/doc/progs/helloworld3.go
diff options
context:
space:
mode:
Diffstat (limited to 'doc/progs/helloworld3.go')
-rw-r--r--doc/progs/helloworld3.go7
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);
}
}