Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sayboras committed May 23, 2020
1 parent ea9adc8 commit 07c2097
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/testdata/exportloopref.go
Expand Up @@ -10,11 +10,11 @@ func dummyFunction() {
println("loop expecting 10, 11, 12, 13")
for i, p := range []int{10, 11, 12, 13} {
printp(&p)
slice = append(slice, &p) // ERROR : exporting a pointer for the loop variable p
array[i] = &p // ERROR : exporting a pointer for the loop variable p
slice = append(slice, &p) // ERROR : "exporting a pointer for the loop variable p"
array[i] = &p // ERROR : "exporting a pointer for the loop variable p"
if i%2 == 0 {
ref = &p // ERROR : exporting a pointer for the loop variable p
str.x = &p // ERROR : exporting a pointer for the loop variable p
ref = &p // ERROR : "exporting a pointer for the loop variable p"
str.x = &p // ERROR : "exporting a pointer for the loop variable p"
}
var vStr struct{ x *int }
var vArray [4]*int
Expand Down

0 comments on commit 07c2097

Please sign in to comment.