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

Flags necessary elements of function signature #36

Closed
akerl opened this issue Jan 12, 2019 · 3 comments
Closed

Flags necessary elements of function signature #36

akerl opened this issue Jan 12, 2019 · 3 comments

Comments

@akerl
Copy link

akerl commented Jan 12, 2019

Looking at https://github.com/akerl/voyager/blob/b3c2a92371cac8d4a59d5f058d71e3cc011c9310/prompt/wmenu.go#L17-L20 , I get the following error:

~/.go/src/github.com/akerl/voyager/prompt master*
❯ unparam -debug
func WithWmenu$1
parameter opts : []github.com/akerl/voyager/vendor/github.com/dixonwille/wmenu.Opt
  skip - used somewhere in the func body
wmenu.go:17:39: WithWmenu$1 - result 0 (error) is always nil

The code in question:

	menu.Action(func(opts []wmenu.Opt) error {
		c <- opts[0].ID
		return nil
	})

While it's correct that I'm not ever setting the return to something other than nil, the error is a crucial part of the function signature, given that it's needed by menu.Action()

@mvdan
Copy link
Owner

mvdan commented Jan 21, 2019

Thanks for reporting. Seems like a clear false positive.

@mvdan
Copy link
Owner

mvdan commented Jan 21, 2019

Actually very similar to #35. Will try to fix both together.

@mvdan mvdan closed this as completed in 0f1251b Jan 24, 2019
@mvdan
Copy link
Owner

mvdan commented Jan 24, 2019

Fixed - please shout if you find any other false positives.

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

2 participants