diff options
author | Ian Lance Taylor <iant@golang.org> | 2010-08-31 07:34:01 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2010-08-31 07:34:01 -0700 |
commit | a1ca80f6980d59055a0692b02285da7db666f83f (patch) | |
tree | e48982a73781dac3929c615fc717bf8bcee699cd /test/ken | |
parent | 717ac1f25bf7229239c53170974f9fb4e2a758e1 (diff) | |
download | go-a1ca80f6980d59055a0692b02285da7db666f83f.tar.gz |
test: don't assign address of array to slice.
R=rsc
CC=golang-dev
http://codereview.appspot.com/2084042
Diffstat (limited to 'test/ken')
-rw-r--r-- | test/ken/array.go | 8 | ||||
-rw-r--r-- | test/ken/slicearray.go | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/test/ken/array.go b/test/ken/array.go index 7785cdf8f..40209f5da 100644 --- a/test/ken/array.go +++ b/test/ken/array.go @@ -81,8 +81,8 @@ func testpfpf() { // call ptr dynamic with ptr fixed from new func testpdpf1() { a := new([40]int) - setpd(a) - res(sumpd(a), 0, 40) + setpd(a[0:]) + res(sumpd(a[0:]), 0, 40) b := (*a)[5:30] res(sumpd(b), 5, 30) @@ -92,8 +92,8 @@ func testpdpf1() { func testpdpf2() { var a [80]int - setpd(&a) - res(sumpd(&a), 0, 80) + setpd(a[0:]) + res(sumpd(a[0:]), 0, 80) } // generate bounds error with ptr dynamic diff --git a/test/ken/slicearray.go b/test/ken/slicearray.go index 76ec80931..536bbf56b 100644 --- a/test/ken/slicearray.go +++ b/test/ken/slicearray.go @@ -16,12 +16,12 @@ var t int func main() { lb = 0 hb = 10 - by = &bx + by = bx[0:] tstb() lb = 0 hb = 10 - fy = &fx + fy = fx[0:] tstf() // width 1 (byte) |