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 ae66fb6b03..4e1c3a2914 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 ae2d6c93e2..aa3b28d581 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 f795f85bc8..35ebbf6022 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 2d1d96c18a..223898ef89 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 9353e12cdf..a82c8a7d64 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 b72d1c1c6c..1c93a1881a 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 bb5370d0d4..3a7cb23825 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 caf42555d1..20dc78a19d 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 333bbbcb7f..32766d9998 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 d0a46c61a2..6783c54c93 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 83094a4ea2..5cedb3e96f 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 76eecd2c23..84765c73b4 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 3be931aeab..7087cb92e1 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 dac42e4b06..2aec2d1d62 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 3f214b66aa..fe64d9c1d6 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 1ee328a00e..ab3e980a87 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 990b9d2202..3181428aab 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 74afb92e93..286d12cb1b 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 26e6361dae..5d48d93903 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 3ba6eacf5f..fc4a70787a 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 b3bd28dd13..6105f360dd 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 15078cc0d1..491408853e 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 301428cd9a..57be812ed5 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 c4d87bb58e..cb91847427 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 cd5a4f12c2..6e765ee97d 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 acb3da97b9..39436e9254 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 85be3927a5..088f8efb61 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 5ef03fa8c8..2174beb69e 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 1210567f15..8b826db72b 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 2c5db65911..2b1e19dcd9 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 bb6ba54c9a..959e3f5377 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 7b6ab1998a..4d3924bcc7 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 0d96ea4ed5..2395832d1c 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 692681b3d1..782275451d 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 4088972057..349338fa11 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 4c136af8ad..4eb549b0a0 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 81994d085e..27c5dc304f 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 622b67b98f..5c83efc986 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 5319fdbed9..9f1561ea6f 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 f597b7552d..584ade8ad6 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 4b74dc352d..f33654affd 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 a4937465bb..f93951ac29 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 d04679d6d6..2468261487 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 0a7d852d20..c33bd9d114 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 9328c40204..94128ac465 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 624a0a2592..ab33ee61ab 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 f49e5ef6d3..d0a1637498 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 7bf419cbc4..3ef704afa6 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 7f66207cc0..01fb98508d 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 37b764fe51..dd3acaf287 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 f67d6d7806..c29a26de55 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 992e79fff9..f6954ff7f0 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 5860ca96bd..6bc359bf89 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 01e6c0f21f..2bb6a20e8c 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 2884150a95..45bb76ce66 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 ab180929d8..8896d137d8 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 d6111d93e5..7c2b42107b 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 bb4069b8d8..36d52d2953 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 774598b337..20cd88af49 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 c1366be1cd..993ac92f4c 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 (