From 70216b662dc440faaebab531deb35f0f0c633d17 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 14 Dec 2023 13:51:57 +0100 Subject: [PATCH] add //go:build directives to prevent downgrading to go1.16 language This is a follow-up to 0e73168b7e6d1d029d76d05b843b1aaec46739a8 This repository is not yet a module (i.e., does not have a `go.mod`). This is not problematic when building the code in GOPATH or "vendor" mode, but when using the code as a module-dependency (in module-mode), different semantics are applied since Go1.21, which switches Go _language versions_ on a per-module, per-package, or even per-file base. A condensed summary of that logic [is as follows][1]: - For modules that have a go.mod containing a go version directive; that version is considered a minimum _required_ version (starting with the go1.19.13 and go1.20.8 patch releases: before those, it was only a recommendation). - For dependencies that don't have a go.mod (not a module), go language version go1.16 is assumed. - Likewise, for modules that have a go.mod, but the file does not have a go version directive, go language version go1.16 is assumed. - If a go.work file is present, but does not have a go version directive, language version go1.17 is assumed. When switching language versions, Go _downgrades_ the language version, which means that language features (such as generics, and `any`) are not available, and compilation fails. For example: # github.com/docker/cli/cli/context/store /go/pkg/mod/github.com/docker/cli@v25.0.0-beta.2+incompatible/cli/context/store/storeconfig.go:6:24: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod) /go/pkg/mod/github.com/docker/cli@v25.0.0-beta.2+incompatible/cli/context/store/store.go:74:12: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod) Note that these fallbacks are per-module, per-package, and can even be per-file, so _(indirect) dependencies_ can still use modern language features, as long as their respective go.mod has a version specified. Unfortunately, these failures do not occur when building locally (using vendor / GOPATH mode), but will affect consumers of the module. Obviously, this situation is not ideal, and the ultimate solution is to move to go modules (add a go.mod), but this comes with a non-insignificant risk in other areas (due to our complex dependency tree). We can revert to using go1.16 language features only, but this may be limiting, and may still be problematic when (e.g.) matching signatures of dependencies. There is an escape hatch: adding a `//go:build` directive to files that make use of go language features. From the [go toolchain docs][2]: > The go line for each module sets the language version the compiler enforces > when compiling packages in that module. The language version can be changed > on a per-file basis by using a build constraint. > > For example, a module containing code that uses the Go 1.21 language version > should have a `go.mod` file with a go line such as `go 1.21` or `go 1.21.3`. > If a specific source file should be compiled only when using a newer Go > toolchain, adding `//go:build go1.22` to that source file both ensures that > only Go 1.22 and newer toolchains will compile the file and also changes > the language version in that file to Go 1.22. This patch adds `//go:build` directives to those files using recent additions to the language. 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). For completeness sake, note that any file _without_ a `//go:build` directive will continue to use go1.16 language version when used as a module. [1]: https://github.com/golang/go/blob/58c28ba286dd0e98fe4cca80f5d64bbcb824a685/src/cmd/go/internal/gover/version.go#L9-L56 [2]; https://go.dev/doc/toolchain#:~:text=The%20go%20line%20for,file%20to%20Go%201.22 Signed-off-by: Sebastiaan van Stijn --- cli-plugins/manager/error.go | 3 +++ cli/command/cli.go | 3 +++ cli/command/config/inspect.go | 3 +++ cli/command/container/inspect.go | 3 +++ cli/command/context.go | 3 +++ cli/command/context/create.go | 3 +++ cli/command/context/create_test.go | 3 +++ cli/command/context/inspect.go | 3 +++ cli/command/context_test.go | 3 +++ cli/command/defaultcontextstore.go | 3 +++ cli/command/defaultcontextstore_test.go | 3 +++ cli/command/formatter/container.go | 3 +++ cli/command/formatter/container_test.go | 3 +++ cli/command/formatter/custom.go | 3 +++ cli/command/formatter/formatter.go | 3 +++ cli/command/formatter/formatter_test.go | 3 +++ cli/command/formatter/reflect.go | 3 +++ cli/command/formatter/reflect_test.go | 3 +++ cli/command/formatter/volume_test.go | 3 +++ cli/command/idresolver/idresolver.go | 3 +++ cli/command/image/inspect.go | 3 +++ cli/command/inspect/inspector.go | 3 +++ cli/command/network/formatter_test.go | 3 +++ cli/command/network/inspect.go | 3 +++ cli/command/node/formatter_test.go | 3 +++ cli/command/node/inspect.go | 3 +++ cli/command/plugin/formatter_test.go | 3 +++ cli/command/plugin/inspect.go | 3 +++ cli/command/secret/inspect.go | 3 +++ cli/command/service/formatter_test.go | 3 +++ cli/command/service/inspect.go | 3 +++ cli/command/service/inspect_test.go | 3 +++ cli/command/service/opts.go | 3 +++ cli/command/stack/loader/loader.go | 3 +++ cli/command/system/info.go | 3 +++ cli/command/system/inspect.go | 3 +++ cli/command/trust/inspect.go | 3 +++ cli/command/utils.go | 3 +++ cli/command/volume/inspect.go | 3 +++ cli/compose/interpolation/interpolation.go | 3 +++ cli/compose/interpolation/interpolation_test.go | 3 +++ cli/compose/loader/full-struct_test.go | 3 +++ cli/compose/loader/interpolate.go | 3 +++ cli/compose/loader/loader.go | 3 +++ cli/compose/loader/loader_test.go | 3 +++ cli/compose/loader/merge.go | 3 +++ cli/compose/loader/merge_test.go | 3 +++ cli/compose/schema/schema.go | 3 +++ cli/compose/schema/schema_test.go | 3 +++ cli/compose/template/template.go | 3 +++ cli/compose/template/template_test.go | 3 +++ cli/compose/types/types.go | 3 +++ cli/context/store/metadata_test.go | 3 +++ cli/context/store/metadatastore.go | 3 +++ cli/context/store/store.go | 3 +++ cli/context/store/store_test.go | 3 +++ cli/context/store/storeconfig.go | 3 +++ cli/context/store/storeconfig_test.go | 3 +++ cmd/docker/builder_test.go | 3 +++ templates/templates.go | 3 +++ 60 files changed, 180 insertions(+) diff --git a/cli-plugins/manager/error.go b/cli-plugins/manager/error.go index ae66fb6b03e3..4e1c3a291446 100644 --- a/cli-plugins/manager/error.go +++ b/cli-plugins/manager/error.go @@ -1,3 +1,6 @@ +// 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 + package manager import ( diff --git a/cli/command/cli.go b/cli/command/cli.go index ae2d6c93e238..aa3b28d58124 100644 --- a/cli/command/cli.go +++ b/cli/command/cli.go @@ -1,3 +1,6 @@ +// 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 + package command import ( diff --git a/cli/command/config/inspect.go b/cli/command/config/inspect.go index f795f85bc83b..35ebbf6022c1 100644 --- a/cli/command/config/inspect.go +++ b/cli/command/config/inspect.go @@ -1,3 +1,6 @@ +// 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 + package config import ( diff --git a/cli/command/container/inspect.go b/cli/command/container/inspect.go index 2d1d96c18a1d..223898ef892f 100644 --- a/cli/command/container/inspect.go +++ b/cli/command/container/inspect.go @@ -1,3 +1,6 @@ +// 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 + package container import ( diff --git a/cli/command/context.go b/cli/command/context.go index 9353e12cdf97..a82c8a7d6442 100644 --- a/cli/command/context.go +++ b/cli/command/context.go @@ -1,3 +1,6 @@ +// 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 + package command import ( diff --git a/cli/command/context/create.go b/cli/command/context/create.go index b72d1c1c6c2f..1c93a1881aa3 100644 --- a/cli/command/context/create.go +++ b/cli/command/context/create.go @@ -1,3 +1,6 @@ +// 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 + package context import ( diff --git a/cli/command/context/create_test.go b/cli/command/context/create_test.go index bb5370d0d477..3a7cb238258d 100644 --- a/cli/command/context/create_test.go +++ b/cli/command/context/create_test.go @@ -1,3 +1,6 @@ +// 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 + package context import ( diff --git a/cli/command/context/inspect.go b/cli/command/context/inspect.go index caf42555d1c0..20dc78a19dd3 100644 --- a/cli/command/context/inspect.go +++ b/cli/command/context/inspect.go @@ -1,3 +1,6 @@ +// 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 + package context import ( diff --git a/cli/command/context_test.go b/cli/command/context_test.go index 333bbbcb7fce..32766d999806 100644 --- a/cli/command/context_test.go +++ b/cli/command/context_test.go @@ -1,3 +1,6 @@ +// 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 + package command import ( diff --git a/cli/command/defaultcontextstore.go b/cli/command/defaultcontextstore.go index d0a46c61a218..6783c54c93ce 100644 --- a/cli/command/defaultcontextstore.go +++ b/cli/command/defaultcontextstore.go @@ -1,3 +1,6 @@ +// 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 + package command import ( diff --git a/cli/command/defaultcontextstore_test.go b/cli/command/defaultcontextstore_test.go index 83094a4ea22b..5cedb3e96f56 100644 --- a/cli/command/defaultcontextstore_test.go +++ b/cli/command/defaultcontextstore_test.go @@ -1,3 +1,6 @@ +// 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 + package command import ( diff --git a/cli/command/formatter/container.go b/cli/command/formatter/container.go index 76eecd2c2398..84765c73b4d2 100644 --- a/cli/command/formatter/container.go +++ b/cli/command/formatter/container.go @@ -1,3 +1,6 @@ +// 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 + package formatter import ( diff --git a/cli/command/formatter/container_test.go b/cli/command/formatter/container_test.go index 3be931aeabae..7087cb92e1dc 100644 --- a/cli/command/formatter/container_test.go +++ b/cli/command/formatter/container_test.go @@ -1,3 +1,6 @@ +// 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 + package formatter import ( diff --git a/cli/command/formatter/custom.go b/cli/command/formatter/custom.go index dac42e4b0664..2aec2d1d6229 100644 --- a/cli/command/formatter/custom.go +++ b/cli/command/formatter/custom.go @@ -1,3 +1,6 @@ +// 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 + package formatter import "strings" diff --git a/cli/command/formatter/formatter.go b/cli/command/formatter/formatter.go index 3f214b66aa97..fe64d9c1d621 100644 --- a/cli/command/formatter/formatter.go +++ b/cli/command/formatter/formatter.go @@ -1,3 +1,6 @@ +// 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 + package formatter import ( diff --git a/cli/command/formatter/formatter_test.go b/cli/command/formatter/formatter_test.go index 1ee328a00ec7..ab3e980a879b 100644 --- a/cli/command/formatter/formatter_test.go +++ b/cli/command/formatter/formatter_test.go @@ -1,3 +1,6 @@ +// 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 + package formatter import ( diff --git a/cli/command/formatter/reflect.go b/cli/command/formatter/reflect.go index 990b9d2202de..3181428aabb0 100644 --- a/cli/command/formatter/reflect.go +++ b/cli/command/formatter/reflect.go @@ -1,3 +1,6 @@ +// 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 + package formatter import ( diff --git a/cli/command/formatter/reflect_test.go b/cli/command/formatter/reflect_test.go index 74afb92e93dc..286d12cb1b90 100644 --- a/cli/command/formatter/reflect_test.go +++ b/cli/command/formatter/reflect_test.go @@ -1,3 +1,6 @@ +// 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 + package formatter import ( diff --git a/cli/command/formatter/volume_test.go b/cli/command/formatter/volume_test.go index 26e6361dae55..5d48d93903d7 100644 --- a/cli/command/formatter/volume_test.go +++ b/cli/command/formatter/volume_test.go @@ -1,3 +1,6 @@ +// 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 + package formatter import ( diff --git a/cli/command/idresolver/idresolver.go b/cli/command/idresolver/idresolver.go index 3ba6eacf5f21..fc4a70787a59 100644 --- a/cli/command/idresolver/idresolver.go +++ b/cli/command/idresolver/idresolver.go @@ -1,3 +1,6 @@ +// 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 + package idresolver import ( diff --git a/cli/command/image/inspect.go b/cli/command/image/inspect.go index b3bd28dd131a..6105f360dd9e 100644 --- a/cli/command/image/inspect.go +++ b/cli/command/image/inspect.go @@ -1,3 +1,6 @@ +// 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 + package image import ( diff --git a/cli/command/inspect/inspector.go b/cli/command/inspect/inspector.go index 15078cc0d1f5..491408853e9a 100644 --- a/cli/command/inspect/inspector.go +++ b/cli/command/inspect/inspector.go @@ -1,3 +1,6 @@ +// 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 + package inspect import ( diff --git a/cli/command/network/formatter_test.go b/cli/command/network/formatter_test.go index 301428cd9a0f..57be812ed5ad 100644 --- a/cli/command/network/formatter_test.go +++ b/cli/command/network/formatter_test.go @@ -1,3 +1,6 @@ +// 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 + package network import ( diff --git a/cli/command/network/inspect.go b/cli/command/network/inspect.go index c4d87bb58e88..cb91847427c2 100644 --- a/cli/command/network/inspect.go +++ b/cli/command/network/inspect.go @@ -1,3 +1,6 @@ +// 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 + package network import ( diff --git a/cli/command/node/formatter_test.go b/cli/command/node/formatter_test.go index cd5a4f12c22d..6e765ee97db9 100644 --- a/cli/command/node/formatter_test.go +++ b/cli/command/node/formatter_test.go @@ -1,3 +1,6 @@ +// 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 + package node import ( diff --git a/cli/command/node/inspect.go b/cli/command/node/inspect.go index acb3da97b9f8..39436e92540c 100644 --- a/cli/command/node/inspect.go +++ b/cli/command/node/inspect.go @@ -1,3 +1,6 @@ +// 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 + package node import ( diff --git a/cli/command/plugin/formatter_test.go b/cli/command/plugin/formatter_test.go index 85be3927a561..088f8efb619a 100644 --- a/cli/command/plugin/formatter_test.go +++ b/cli/command/plugin/formatter_test.go @@ -1,3 +1,6 @@ +// 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 + package plugin import ( diff --git a/cli/command/plugin/inspect.go b/cli/command/plugin/inspect.go index 5ef03fa8c8a9..2174beb69e38 100644 --- a/cli/command/plugin/inspect.go +++ b/cli/command/plugin/inspect.go @@ -1,3 +1,6 @@ +// 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 + package plugin import ( diff --git a/cli/command/secret/inspect.go b/cli/command/secret/inspect.go index 1210567f15ac..8b826db72bfc 100644 --- a/cli/command/secret/inspect.go +++ b/cli/command/secret/inspect.go @@ -1,3 +1,6 @@ +// 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 + package secret import ( diff --git a/cli/command/service/formatter_test.go b/cli/command/service/formatter_test.go index 2c5db659117c..2b1e19dcd9e8 100644 --- a/cli/command/service/formatter_test.go +++ b/cli/command/service/formatter_test.go @@ -1,3 +1,6 @@ +// 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 + package service import ( diff --git a/cli/command/service/inspect.go b/cli/command/service/inspect.go index bb6ba54c9ae4..959e3f5377b1 100644 --- a/cli/command/service/inspect.go +++ b/cli/command/service/inspect.go @@ -1,3 +1,6 @@ +// 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 + package service import ( diff --git a/cli/command/service/inspect_test.go b/cli/command/service/inspect_test.go index 7b6ab1998ac1..4d3924bcc7d9 100644 --- a/cli/command/service/inspect_test.go +++ b/cli/command/service/inspect_test.go @@ -1,3 +1,6 @@ +// 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 + package service import ( diff --git a/cli/command/service/opts.go b/cli/command/service/opts.go index 0d96ea4ed562..2395832d1c23 100644 --- a/cli/command/service/opts.go +++ b/cli/command/service/opts.go @@ -1,3 +1,6 @@ +// 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 + package service import ( diff --git a/cli/command/stack/loader/loader.go b/cli/command/stack/loader/loader.go index 692681b3d18f..782275451dcf 100644 --- a/cli/command/stack/loader/loader.go +++ b/cli/command/stack/loader/loader.go @@ -1,3 +1,6 @@ +// 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 + package loader import ( diff --git a/cli/command/system/info.go b/cli/command/system/info.go index 408897205708..349338fa119f 100644 --- a/cli/command/system/info.go +++ b/cli/command/system/info.go @@ -1,3 +1,6 @@ +// 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 + package system import ( diff --git a/cli/command/system/inspect.go b/cli/command/system/inspect.go index 4c136af8ad9a..4eb549b0a0ae 100644 --- a/cli/command/system/inspect.go +++ b/cli/command/system/inspect.go @@ -1,3 +1,6 @@ +// 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 + package system import ( diff --git a/cli/command/trust/inspect.go b/cli/command/trust/inspect.go index 81994d085e2c..27c5dc304fa1 100644 --- a/cli/command/trust/inspect.go +++ b/cli/command/trust/inspect.go @@ -1,3 +1,6 @@ +// 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 + package trust import ( diff --git a/cli/command/utils.go b/cli/command/utils.go index 622b67b98fd5..5c83efc98674 100644 --- a/cli/command/utils.go +++ b/cli/command/utils.go @@ -1,3 +1,6 @@ +// 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 + package command import ( diff --git a/cli/command/volume/inspect.go b/cli/command/volume/inspect.go index 5319fdbed93a..9f1561ea6fec 100644 --- a/cli/command/volume/inspect.go +++ b/cli/command/volume/inspect.go @@ -1,3 +1,6 @@ +// 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 + package volume import ( diff --git a/cli/compose/interpolation/interpolation.go b/cli/compose/interpolation/interpolation.go index f597b7552dc7..584ade8ad600 100644 --- a/cli/compose/interpolation/interpolation.go +++ b/cli/compose/interpolation/interpolation.go @@ -1,3 +1,6 @@ +// 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 + package interpolation import ( diff --git a/cli/compose/interpolation/interpolation_test.go b/cli/compose/interpolation/interpolation_test.go index 4b74dc352dc2..f33654affd5d 100644 --- a/cli/compose/interpolation/interpolation_test.go +++ b/cli/compose/interpolation/interpolation_test.go @@ -1,3 +1,6 @@ +// 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 + package interpolation import ( diff --git a/cli/compose/loader/full-struct_test.go b/cli/compose/loader/full-struct_test.go index a4937465bb0a..f93951ac298f 100644 --- a/cli/compose/loader/full-struct_test.go +++ b/cli/compose/loader/full-struct_test.go @@ -1,3 +1,6 @@ +// 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 + package loader import ( diff --git a/cli/compose/loader/interpolate.go b/cli/compose/loader/interpolate.go index d04679d6d601..24682614877b 100644 --- a/cli/compose/loader/interpolate.go +++ b/cli/compose/loader/interpolate.go @@ -1,3 +1,6 @@ +// 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 + package loader import ( diff --git a/cli/compose/loader/loader.go b/cli/compose/loader/loader.go index 0a7d852d2057..c33bd9d1146d 100644 --- a/cli/compose/loader/loader.go +++ b/cli/compose/loader/loader.go @@ -1,3 +1,6 @@ +// 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 + package loader import ( diff --git a/cli/compose/loader/loader_test.go b/cli/compose/loader/loader_test.go index 9328c4020444..94128ac465c4 100644 --- a/cli/compose/loader/loader_test.go +++ b/cli/compose/loader/loader_test.go @@ -1,3 +1,6 @@ +// 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 + package loader import ( diff --git a/cli/compose/loader/merge.go b/cli/compose/loader/merge.go index 624a0a259201..ab33ee61ab44 100644 --- a/cli/compose/loader/merge.go +++ b/cli/compose/loader/merge.go @@ -1,3 +1,6 @@ +// 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 + package loader import ( diff --git a/cli/compose/loader/merge_test.go b/cli/compose/loader/merge_test.go index f49e5ef6d37a..d0a1637498a7 100644 --- a/cli/compose/loader/merge_test.go +++ b/cli/compose/loader/merge_test.go @@ -1,3 +1,6 @@ +// 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 + package loader import ( diff --git a/cli/compose/schema/schema.go b/cli/compose/schema/schema.go index 7bf419cbc464..3ef704afa630 100644 --- a/cli/compose/schema/schema.go +++ b/cli/compose/schema/schema.go @@ -1,3 +1,6 @@ +// 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 + package schema import ( diff --git a/cli/compose/schema/schema_test.go b/cli/compose/schema/schema_test.go index 7f66207cc028..01fb98508d7b 100644 --- a/cli/compose/schema/schema_test.go +++ b/cli/compose/schema/schema_test.go @@ -1,3 +1,6 @@ +// 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 + package schema import ( diff --git a/cli/compose/template/template.go b/cli/compose/template/template.go index 37b764fe5159..dd3acaf28787 100644 --- a/cli/compose/template/template.go +++ b/cli/compose/template/template.go @@ -1,3 +1,6 @@ +// 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 + package template import ( diff --git a/cli/compose/template/template_test.go b/cli/compose/template/template_test.go index f67d6d7806bf..c29a26de559f 100644 --- a/cli/compose/template/template_test.go +++ b/cli/compose/template/template_test.go @@ -1,3 +1,6 @@ +// 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 + package template import ( diff --git a/cli/compose/types/types.go b/cli/compose/types/types.go index 992e79fff920..f6954ff7f0ae 100644 --- a/cli/compose/types/types.go +++ b/cli/compose/types/types.go @@ -1,3 +1,6 @@ +// 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 + package types import ( diff --git a/cli/context/store/metadata_test.go b/cli/context/store/metadata_test.go index 5860ca96bddf..6bc359bf89ea 100644 --- a/cli/context/store/metadata_test.go +++ b/cli/context/store/metadata_test.go @@ -1,3 +1,6 @@ +// 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 + package store import ( diff --git a/cli/context/store/metadatastore.go b/cli/context/store/metadatastore.go index 01e6c0f21fd0..2bb6a20e8c61 100644 --- a/cli/context/store/metadatastore.go +++ b/cli/context/store/metadatastore.go @@ -1,3 +1,6 @@ +// 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 + package store import ( diff --git a/cli/context/store/store.go b/cli/context/store/store.go index 2884150a951b..45bb76ce6664 100644 --- a/cli/context/store/store.go +++ b/cli/context/store/store.go @@ -1,3 +1,6 @@ +// 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 + package store import ( diff --git a/cli/context/store/store_test.go b/cli/context/store/store_test.go index ab180929d835..8896d137d8b2 100644 --- a/cli/context/store/store_test.go +++ b/cli/context/store/store_test.go @@ -1,3 +1,6 @@ +// 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 + package store import ( diff --git a/cli/context/store/storeconfig.go b/cli/context/store/storeconfig.go index d6111d93e5d3..7c2b42107b9f 100644 --- a/cli/context/store/storeconfig.go +++ b/cli/context/store/storeconfig.go @@ -1,3 +1,6 @@ +// 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 + package store // TypeGetter is a func used to determine the concrete type of a context or diff --git a/cli/context/store/storeconfig_test.go b/cli/context/store/storeconfig_test.go index bb4069b8d89f..36d52d29535c 100644 --- a/cli/context/store/storeconfig_test.go +++ b/cli/context/store/storeconfig_test.go @@ -1,3 +1,6 @@ +// 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 + package store import ( diff --git a/cmd/docker/builder_test.go b/cmd/docker/builder_test.go index 774598b33724..20cd88af4951 100644 --- a/cmd/docker/builder_test.go +++ b/cmd/docker/builder_test.go @@ -1,3 +1,6 @@ +// 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 + package main import ( diff --git a/templates/templates.go b/templates/templates.go index c1366be1cde9..993ac92f4c76 100644 --- a/templates/templates.go +++ b/templates/templates.go @@ -1,3 +1,6 @@ +// 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 + package templates import (