From ca4e8ebdbda73956585039e297c7ce078b9842fb 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 (cherry picked from commit 70216b662dc440faaebab531deb35f0f0c633d17) 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 11822d660c..d1fbb391d5 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 1551c14da8..1fdb5bedd7 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 64773419ad..baab76161a 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 b9e320b827..0fedd293a4 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 29a2be860f..5c4e0bc243 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 757d40adef..62d18a6469 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 e962f5a680..603b95b765 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 ddd0f92639..4d6d5d589f 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 7ef2157942..5b5bb70725 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 95f89fc6ff..302d3869d4 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 a368135ff7..a9f40d3c7b 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 60ad2fa40b..be231cc9b3 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 1c09a57791..8dfb2a39b3 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 2d6c979c32..1002c218b5 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 55c5ea6e02..92bd45ba57 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 0f7ca93442..572d1f9b6d 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 9d153bc988..267d952923 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 c4e2383f03..3f17aaa288 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 64997a2d81..2e7b5a5209 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 4bc2e4acab..73268d4657 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 2e3d5bf086..56a9cca3a7 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 4a6f210807..76695788eb 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 b7807cd536..090d6b2900 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 33dba10df7..5751bb2f34 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 afa44981ae..17f095cc96 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 96abfd1927..79a5f3e07e 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 a5e1a4b1f7..8013df45af 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 c84711af2b..7696c1d0f2 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 2b63ecc4b2..e096015140 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 574f57e30d..205b072b1e 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 16df0c1003..fe1da86b42 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 15f9209278..8b631f249c 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 2149241af2..7a88e6213c 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 39810d8832..a876adab8b 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 cef7dc9856..b9a11751b4 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 bccc7dde44..e6d4ea2aae 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 d7370bd09d..9b39a5a9b3 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 753f428aa0..b9da9bc4a6 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 4bf35b26b8..fa76857d89 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 e84756dba6..07d505872a 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 069d8d2549..10bf19f770 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 17536816df..d44d84c11c 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 d25936be86..551e0c90e6 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 a9b8f1f1f9..a3bd73fb71 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 0be15d2fa4..039564e109 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 57bc2296b7..b4751d570f 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 e5aa3eab13..5fda852e91 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 3481780c98..e7266399d4 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 a8aebfe265..27a10f5cc9 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 f8e507a90b..dd884903e9 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 0406969900..c741a62813 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 ed2e10e85b..69961850e0 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 fcb46c54f5..1e12364e71 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 62c3f82a6a..9b45ea9250 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 7101252303..192787b913 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 235870a954..0b6b2d544e 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 9c93ecbab2..482a4ef70f 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 e5b8c75686..efb4587c88 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 0ef79a65dd..5941759bab 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 deb043299d..e00dae4c08 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 (