-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
Description
Compiling with v29.3.0+incompatible produces compilation error when including github.com/docker/compose/v5 v5.1.1.
../go/pkg/mod/github.com/docker/cli@v29.3.0+incompatible/cli/command/container/tty.go:63:23: cannot range over 10 (untyped int constant): requires go1.22 or later (-lang was set to go1.16; check go.mod)
This makes it impossible to use docker/compose as you need docker/cli to initialize the ComposeService
Reproduce
I have a very small reproduce of this: https://github.com/pedantic79/docker-bug/tree/main
Where the compilation error will occur.
go.mod contains
require (
github.com/docker/cli v29.3.0+incompatible
github.com/docker/compose/v5 v5.1.1
)
main.go contains
func main() {
dockerCli, _ := command.NewDockerCli()
composeService, _ := compose.NewComposeService(dockerCli)
fmt.Println(composeService) // avoid compiler complaining about unused variable
}
Expected behavior
Program to compile
docker version
N/Adocker info
N/AAdditional Info
I can pin to v29.2.1+incompatible and that fixes the issue, as that version doesn't use the for retry := range 10 that was introduced in v29.3.0+incompatible
Reactions are currently unavailable