1
0
mirror of https://github.com/golang/go synced 2024-07-05 09:50:19 +00:00

tests: remove two misuses of nil pointers

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12858044
This commit is contained in:
Russ Cox 2013-08-15 11:51:04 -04:00
parent ff86d222be
commit 08fdf00906
2 changed files with 5 additions and 2 deletions

View File

@ -136,7 +136,9 @@ func TestGcRescan(t *testing.T) {
for i := 0; i < 10; i++ {
p := &Y{}
p.c = make(chan error)
p.nextx = &head.X
if head != nil {
p.nextx = &head.X
}
p.nexty = head
p.p = new(int)
*p.p = 42

View File

@ -64,7 +64,8 @@ func main() {
i = 99999
var sl []int
check("array-bounds", func() { println(p[i]) }, "index out of range")
p1 := new([10]int)
check("array-bounds", func() { println(p1[i]) }, "index out of range")
check("slice-bounds", func() { println(sl[i]) }, "index out of range")
var inter interface{}