authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-23 13:56:49-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-23 13:57:37-05:00
log45081c1e9cc28757cb563c77553631f7a92b29d8
tree9ccb5708c94570fc8edc2e6fd925d60fd0916f96
parent218a4d4b30f320797121ad9900d48743da77a1b3
signaturelock-open Commit is signed but in an unrecognized format.

hello world example can use `const` instead of `var`


2 files changed, 2 insertions(+), 2 deletions(-)

doc/langref.html.in+1-1
......@@ -165,7 +165,7 @@ const std = @import("std");
165165
166166pub fn main() !void {
167167 // If this program is run without stdout attached, exit with an error.
168 var stdout_file = try std.io.getStdOut();
168 const stdout_file = try std.io.getStdOut();
169169 // If this program encounters pipe failure when printing to stdout, exit
170170 // with an error.
171171 try stdout_file.write("Hello, world!\n");
example/hello_world/hello.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22
33pub fn main() !void {
44 // If this program is run without stdout attached, exit with an error.
5 var stdout_file = try std.io.getStdOut();
5 const stdout_file = try std.io.getStdOut();
66 // If this program encounters pipe failure when printing to stdout, exit
77 // with an error.
88 try stdout_file.write("Hello, world!\n");