Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails to detect a real issue #7

Closed
kyoh86 opened this issue Apr 22, 2021 · 1 comment
Closed

fails to detect a real issue #7

kyoh86 opened this issue Apr 22, 2021 · 1 comment
Assignees

Comments

@kyoh86
Copy link
Owner

kyoh86 commented Apr 22, 2021

  • test/testdata/exportloopref.go:18:11 is a real issue but not detected by looppointer
proof
package main

func main() {
	var ref *int

	for _, v := range []int{10, 11, 12, 13} {
		if v == 11 {
			ref = &v
		}
	}
	printp(ref)
}

func printp(p *int) {
	println(*p)
}
$ go run main.go 
13

Originally posted by @ldez in golangci/golangci-lint#1924 (comment)

@kyoh86 kyoh86 changed the title The test data test/testdata/looppointer.go gives the same output with exportloopref: fails to detect a real issue Apr 22, 2021
kyoh86 added a commit that referenced this issue May 5, 2021
@kyoh86
Copy link
Owner Author

kyoh86 commented May 5, 2021

it's not an issue

@kyoh86 kyoh86 closed this as completed May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant