mirror of
https://github.com/golang/go
synced 2024-11-24 23:07:56 -07: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:
parent
ff86d222be
commit
08fdf00906
@ -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
|
||||
|
@ -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{}
|
||||
|
Loading…
Reference in New Issue
Block a user