Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Staticcheck keeps showing false warnings pertaining to code in files of package main. How to fix? #3169

Unanswered
squint2 asked this question in Help
Discussion options

Types and functions that exist in files of package main are not being recognized in main.go, so they flag as undefined warnings by the staticchecker(?!).

The app runs without issues, but it's annoying to see so many warnings that are false. One solution is place all code in the main.go file, but that is not great either.

Is there a way to fix this problem? I like having the staticchecker, but also want it to work properly.

Sam

You must be logged in to vote

Replies: 1 comment

Comment options

+1

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /