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

PF-3455 add staticcheck #194

Merged
merged 4 commits into from
Mar 20, 2024
Merged

PF-3455 add staticcheck #194

merged 4 commits into from
Mar 20, 2024

Conversation

svenwltr
Copy link
Member

@svenwltr svenwltr commented Mar 12, 2024

Also make project compatible with go work, because I am trying to use it for better handling of our multi-repos.

@svenwltr svenwltr self-assigned this Mar 12, 2024
Copy link
Member Author

@svenwltr svenwltr left a comment

Choose a reason for hiding this comment

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

This PR contains two not nice changes. Wdyt?

@@ -1,5 +1,5 @@
#!/usr/bin/env sh
set -eu
go mod vendor
test -z "$(go env GOWORK)" && go mod vendor || go work vendor
Copy link
Member Author

Choose a reason for hiding this comment

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

I am testing go work for simplifying major upgrades. Unfortunately go mod vendor complains and demands to use go work vendor. I tried to make it a oneliner to keep the file small and because we would to add this everywhere.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't know about go work until you mentioned it here.

I tried to make it a oneliner to keep the file small and because we would to add this everywhere.

Do we really? We'd only need this in projects that use go work and not everywhere, don't we?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, see my test setup below. If I try to call go mod vendor on anywhere in the projects directory, Go throws an error at me.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

And to actually explain why I try to use go work: When I do a breaking change, I can immediately see the impact on those other projects without need for modifying to go.mod in each project.

So I would do a breaking change and then call my hack/buildall.sh hack, which is basically a for loop.

examples/full/tools.go Show resolved Hide resolved
@svenwltr svenwltr marked this pull request as ready for review March 20, 2024 12:52
@svenwltr svenwltr requested a review from a team as a code owner March 20, 2024 12:52
@svenwltr svenwltr merged commit b05ceae into main Mar 20, 2024
1 check passed
@svenwltr svenwltr deleted the add-staticcheck branch March 20, 2024 13:03
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