cli: add go:build tag to the docker telemetry#4973
Merged
neersighted merged 1 commit intodocker:masterfrom Apr 1, 2024
Merged
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4973 +/- ##
=======================================
Coverage 60.99% 60.99%
=======================================
Files 295 295
Lines 20621 20621
=======================================
Hits 12578 12578
Misses 7149 7149
Partials 894 894 |
This is needed because the project does not have a `go.mod` file and gets sent to go 1.16 semantics whenever it's imported by another project and `any` doesn't exist in go 1.16, but the linter requires us to use `any` here. Setting the `go:build` tag forces the per-file language to the go version specified. Signed-off-by: Jonathan A. Sternberg <[email protected]>
21b0f0c to
2a3b6c0
Compare
krissetto
reviewed
Mar 28, 2024
| @@ -1,3 +1,6 @@ | |||
| // FIXME(jsternberg): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16: | |||
| //go:build go1.19 | |||
Contributor
There was a problem hiding this comment.
is there a reason for 1.19 over 1.18?
Contributor
Author
There was a problem hiding this comment.
This seems to be the version that was chosen by @thaJeztah so I just copied it.
This was the reasoning:
It's currently using go1.19 as version to match the version
in our "vendor.mod", but we can consider being more permissive ("any" requires
go1.18 or up), or more "optimistic" (force go1.21, which is the version we
currently use to build).
neersighted
approved these changes
Apr 1, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
This is needed because the project does not have a
go.modfile andgets sent to go 1.16 semantics whenever it's imported by another project
and
anydoesn't exist in go 1.16, but the linter requires us to useanyhere.Setting the
go:buildtag forces the per-file language to the goversion specified.
- How I did it
Added a
go:buildconstraint similar tocli/cli/command/cli.go
Lines 1 to 2 in 400a8bb