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

Update golangci linter and clean go mod cache #1707

Merged

Conversation

katiewasnothere
Copy link
Contributor

The goal of this PR is to fix a problem seen in #1704. In that PR, it appears that the linter continuously fails with

level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: buildir: failed to load package : could not load export data: no export data for \"github.com/Microsoft/hcsshim/test/internal/require\"\n\n"

However, in that PR that package has been removed and all references to it in the repo have been updated.

We believe this is an issue with the linter's mod cache being out of date. This PR aims to address that by updating the linter version and adding an additional step beforehand to clean the mod cache.

Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
@katiewasnothere katiewasnothere requested a review from a team as a code owner March 23, 2023 21:29
Remove `//nolint` directives for varcheck, deadcode, and
structcheck; they were deprecated in golangci-lint v1.49.

Removed `//nolint` directives for `unused`; it appears a new version of
that linter is less false-positive prone.

Fix instance of loop variable being captured in closure for
`Test_RunPodSandbox_Concurrently` in `policy_test.go`.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Copy link
Contributor

@helsaawy helsaawy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure i should be allowed to approve, but 🤷

@katiewasnothere
Copy link
Contributor Author

Lol thanks for fixing the errors @helsaawy, merging :)

@katiewasnothere katiewasnothere merged commit 144a587 into microsoft:main Mar 23, 2023
@katiewasnothere katiewasnothere deleted the kabaldau/clean_mod_cache branch March 23, 2023 23:21
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 this pull request may close these issues.

3 participants