Skip to content

cli: add go:build tag to the docker telemetry#4973

Merged
neersighted merged 1 commit intodocker:masterfrom
jsternberg:otel-1.16-compat
Apr 1, 2024
Merged

cli: add go:build tag to the docker telemetry#4973
neersighted merged 1 commit intodocker:masterfrom
jsternberg:otel-1.16-compat

Conversation

@jsternberg
Copy link
Copy Markdown
Contributor

@jsternberg jsternberg commented Mar 28, 2024

- What I did

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.

- How I did it

Added a go:build constraint similar to

// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
//go:build go1.19

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 28, 2024

Codecov Report

Merging #4973 (21b0f0c) into master (400a8bb) will not change coverage.
The diff coverage is 0.00%.

❗ Current head 21b0f0c differs from pull request most recent head 2a3b6c0. Consider uploading reports for the commit 2a3b6c0 to get more accurate results

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]>
@jsternberg jsternberg changed the title cli: change any to interface{} for go 1.16 compatibility cli: add go:build tag to the docker telemetry 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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is there a reason for 1.19 over 1.18?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seems to be the version that was chosen by @thaJeztah so I just copied it.

70216b6

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).

Copy link
Copy Markdown
Contributor

@krissetto krissetto left a comment

Choose a reason for hiding this comment

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

just a nit

@neersighted neersighted merged commit 155dc5e into docker:master Apr 1, 2024
@jsternberg jsternberg deleted the otel-1.16-compat branch April 1, 2024 15:09
@thaJeztah thaJeztah added this to the 27.0.0 milestone Apr 2, 2024
@vvoland vvoland modified the milestones: 27.0.0, 26.1.0 Apr 10, 2024
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.

6 participants