Commit 898714a9 authored by Russ Cox's avatar Russ Cox

tutorial fixes

R=r
CC=go-dev
http://go/go-review/1024014
parent e434f1a7
This diff is collapsed.
This diff is collapsed.
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
"os"; "os";
) )
var rot13_flag = flag.Bool("rot13", false, "rot13 the input") var rot13Flag = flag.Bool("rot13", false, "rot13 the input")
func rot13(b byte) byte { func rot13(b byte) byte {
if 'a' <= b && b <= 'z' { if 'a' <= b && b <= 'z' {
...@@ -53,7 +53,7 @@ func cat(r reader) { ...@@ -53,7 +53,7 @@ func cat(r reader) {
const NBUF = 512; const NBUF = 512;
var buf [NBUF]byte; var buf [NBUF]byte;
if *rot13_flag { if *rot13Flag {
r = newRotate13(r) r = newRotate13(r)
} }
for { for {
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
"flag"; // command line option parser "flag"; // command line option parser
) )
var n_flag = flag.Bool("n", false, "don't print final newline") var omitNewline = flag.Bool("n", false, "don't print final newline")
const ( const (
Space = " "; Space = " ";
...@@ -25,7 +25,7 @@ func main() { ...@@ -25,7 +25,7 @@ func main() {
} }
s += flag.Arg(i) s += flag.Arg(i)
} }
if !*n_flag { if !*omitNewline {
s += Newline s += Newline
} }
os.Stdout.WriteString(s); os.Stdout.WriteString(s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment