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

Unavoidable failure #2

Closed
dzpao opened this issue Feb 10, 2020 · 1 comment
Closed

Unavoidable failure #2

dzpao opened this issue Feb 10, 2020 · 1 comment

Comments

@dzpao
Copy link

dzpao commented Feb 10, 2020

I encountered a problem while using dogsled to check my source code. I use tview in my project, which has an API that returns the coordinates and height and width of the rectangle where the UI element is located. Such APIs are common in UI libraries. But my code only needs to know the height, so I have to write this code:

	_, _, _, height := ui.pages.GetRect()

But at this time dogsled told me that this was wrong. But I can’t really assign them to some variables, because I really do n’t need them!

So what should I do?

Thank you!

@alexkohler
Copy link
Owner

alexkohler commented Feb 10, 2020

Hi @dzpao!

You have a couple options:

  • You may use dogsled's -n flag to increase the threshold of blank identifiers allowed in an assignment statement
  • If using golangci-lint, you may use a //nolint:dogsled comment.

Feel free to reopen or reach out if you have any other problems/questions. 🤠

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