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

Detect no type assertion using pointer #6

Closed
adrianlzt opened this issue Mar 11, 2021 · 0 comments · Fixed by #13
Closed

Detect no type assertion using pointer #6

adrianlzt opened this issue Mar 11, 2021 · 0 comments · Fixed by #13

Comments

@adrianlzt
Copy link

In the example below, the first type assertion is not detected because it is converted to a pointer.

I think that kind of conversions without assertion should be also detected.

package main

import "fmt"

type foo struct{}

func main() {
	var field interface{}
	info := *field.(*foo)
	info2 := field.(*foo)
	fmt.Println(info, info2)
}
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

Successfully merging a pull request may close this issue.

1 participant