-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
invalid package name "" when importing tview #622
Comments
Have you tried using |
I just tried updating to v2 ( EDIT: Oops, no, I did not update to v2 because that command is incorrect. However, I just did so and it definitely still happens on all my machines now. |
Here is an updated CI run that now uses gosec v2 showing the problem, if it helps: https://builds.sr.ht/~samwhited/job/510093#task-lint Thanks for taking a look! |
That's weird because github.com/rivo/tview is not defined in go.mod or go.sum of gosec |
It's imported by the project being scanned |
@ccojocar any idea ? |
There is a similar error here |
@SamWhited I think you are installing the v1 instead of v2 of gosec. Could you try to run this command to install the tool:
Also can you make sure that |
I see that you've tried already v2. What does |
Go build and all the other linters I run work just fine |
@SamWhited Can you provide provide a sample of a project where your issue is reproducible? Thanks! |
@ccojocar Sure, you can do more or less what the CI run I linked does:
Wild-ass guess: maybe it's getting confused by the fact that the examples are separate modules from the main library. |
I noticed today that if I cd into |
@SamWhited There is an option available to exclude folders form the scan:
I would use this option instead of hardcoding the name of these folders into the tool. Is this enough for you? If so, I would close this issue. Thanks! |
Personally I would expect the behavior to match the rest of the go tooling, there's no need to hardcode directories, just skip nested modules. |
@SamWhited gosec relies on go build to resolve the go modules, it does not perform any preprocessing related to go modules. I am closing this as out of scope. Thanks |
The Go build command correctly handles nested modules by skipping the others, so something is still going wrong here. Surely this confusing error should at least be updated though to make it obvious what's going on? I'd still request that something be done about this, even if it's not that the behavior of gosec is updated to match all the other tools. Maybe it's just a documentation or error message issue? /cc @ccojocar |
Summary
When running gosec against a package on alpine/edge (but not on Feora 34) I get the error:
Steps to reproduce the behavior
gosec version
Always pulled in CI using
go get
as above. Last run I see was:Go version (output of 'go version')
Operating system / Environment
alpine/edge
Expected behavior
It should run like it used to before this project imported tview.
Actual behavior
This is similar to #580 except not in the standard library so I'm opening this separately.
The text was updated successfully, but these errors were encountered: