summaryrefslogtreecommitdiff
path: root/test/utf.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2010-09-04 10:36:13 +1000
committerRob Pike <r@golang.org>2010-09-04 10:36:13 +1000
commit7c2e17b3e6e4c36a3713e272653dcfc9c2056cfd (patch)
treeb5e309f8922e2f29902d7e085ad3943bb480b856 /test/utf.go
parent83798de970b62e4a4e7b72b9ef53a5d66f71dc3c (diff)
downloadgo-7c2e17b3e6e4c36a3713e272653dcfc9c2056cfd.tar.gz
test: remove semiocolons.
The ken directory is untouched so we have some examples with explicit semis. R=gri CC=golang-dev http://codereview.appspot.com/2157041
Diffstat (limited to 'test/utf.go')
-rw-r--r--test/utf.go60
1 files changed, 30 insertions, 30 deletions
diff --git a/test/utf.go b/test/utf.go
index 59b0ffaa9..a93fc2934 100644
--- a/test/utf.go
+++ b/test/utf.go
@@ -9,46 +9,46 @@ package main
import "utf8"
func main() {
- var chars [6] int;
- chars[0] = 'a';
- chars[1] = 'b';
- chars[2] = 'c';
- chars[3] = '\u65e5';
- chars[4] = '\u672c';
- chars[5] = '\u8a9e';
- s := "";
+ var chars [6] int
+ chars[0] = 'a'
+ chars[1] = 'b'
+ chars[2] = 'c'
+ chars[3] = '\u65e5'
+ chars[4] = '\u672c'
+ chars[5] = '\u8a9e'
+ s := ""
for i := 0; i < 6; i++ {
- s += string(chars[i]);
+ s += string(chars[i])
}
- var l = len(s);
+ var l = len(s)
for w, i, j := 0,0,0; i < l; i += w {
- var r int;
- r, w = utf8.DecodeRuneInString(s[i:len(s)]);
+ var r int
+ r, w = utf8.DecodeRuneInString(s[i:len(s)])
if w == 0 { panic("zero width in string") }
if r != chars[j] { panic("wrong value from string") }
- j++;
+ j++
}
// encoded as bytes: 'a' 'b' 'c' e6 97 a5 e6 9c ac e8 aa 9e
- const L = 12;
+ const L = 12
if L != l { panic("wrong length constructing array") }
- a := make([]byte, L);
- a[0] = 'a';
- a[1] = 'b';
- a[2] = 'c';
- a[3] = 0xe6;
- a[4] = 0x97;
- a[5] = 0xa5;
- a[6] = 0xe6;
- a[7] = 0x9c;
- a[8] = 0xac;
- a[9] = 0xe8;
- a[10] = 0xaa;
- a[11] = 0x9e;
+ a := make([]byte, L)
+ a[0] = 'a'
+ a[1] = 'b'
+ a[2] = 'c'
+ a[3] = 0xe6
+ a[4] = 0x97
+ a[5] = 0xa5
+ a[6] = 0xe6
+ a[7] = 0x9c
+ a[8] = 0xac
+ a[9] = 0xe8
+ a[10] = 0xaa
+ a[11] = 0x9e
for w, i, j := 0,0,0; i < L; i += w {
- var r int;
- r, w = utf8.DecodeRune(a[i:L]);
+ var r int
+ r, w = utf8.DecodeRune(a[i:L])
if w == 0 { panic("zero width in bytes") }
if r != chars[j] { panic("wrong value from bytes") }
- j++;
+ j++
}
}