diff options
author | Rob Pike <r@golang.org> | 2008-09-16 11:00:11 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2008-09-16 11:00:11 -0700 |
commit | f14d65d21b2583798feca40b7075c5a2419f72f5 (patch) | |
tree | 9e3273345700a339607c4a1a5e0d198f71b21523 /doc/progs/cat_rot13.go | |
parent | b0f3941771e69ea0aa784d41c7da8d9590fda41e (diff) | |
download | golang-f14d65d21b2583798feca40b7075c5a2419f72f5.tar.gz |
replace 235 with sieve - less problematic
add programs, not yet described, to demonstrate servers.
R=gri
DELTA=279 (177 added, 16 deleted, 86 changed)
OCL=15380
CL=15389
Diffstat (limited to 'doc/progs/cat_rot13.go')
-rw-r--r-- | doc/progs/cat_rot13.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/doc/progs/cat_rot13.go b/doc/progs/cat_rot13.go index d5050155d..a8c570add 100644 --- a/doc/progs/cat_rot13.go +++ b/doc/progs/cat_rot13.go @@ -11,15 +11,14 @@ import ( var rot13_flag = Flag.Bool("rot13", false, nil, "rot13 the input") -func rot13(bb byte) byte { - var b int = int(bb) /// BUG: until byte division is fixed +func rot13(b byte) byte { if 'a' <= b && b <= 'z' { b = 'a' + ((b - 'a') + 13) % 26; } if 'A' <= b && b <= 'Z' { b = 'A' + ((b - 'A') + 13) % 26 } - return byte(b) + return b } type Reader interface { |