From 32ba0dcea953a044b509081b583b3eed3b27b577 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 7 Jan 2018 01:59:23 -0500 Subject: [PATCH] update hello world docs --- doc/langref.html.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 10bcbe850e..4380ac08a8 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -264,15 +264,14 @@ please file an issue or say something on IRC.

Hello World

-
const io = @import("std").io;
+    
const std = @import("std");
 
 pub fn main() -> %void {
     // If this program is run without stdout attached, exit with an error.
-    var stdout_file = %return io.getStdOut();
-    const stdout = &stdout_file.out_stream;
+    var stdout_file = %return std.io.getStdOut();
     // If this program encounters pipe failure when printing to stdout, exit
     // with an error.
-    %return stdout.print("Hello, world!\n");
+    %return stdout_file.write("Hello, world!\n");
 }
$ zig build-exe hello.zig
 $ ./hello