Skip to content

cannot upgrade package to v1.10.0 #120

@bogcon

Description

@bogcon

Tag v1.9.0 has support for go 1.13 (from go mod file) and in v1.10.0 it was changed to go 1.18.
Isn't this a breaking change?

I want to upgrade dependencies of this project: https://github.com/actforgood/xconf and I get the following error:

go version
go version go1.16.4 darwin/amd64
go get -u
# go.uber.org/atomic
../../../go/pkg/mod/go.uber.org/[email protected]/error.go:55:12: x.v.CompareAndSwap undefined (type Value has no field or method CompareAndSwap)
../../../go/pkg/mod/go.uber.org/[email protected]/error.go:61:24: x.v.Swap undefined (type Value has no field or method Swap)
../../../go/pkg/mod/go.uber.org/[email protected]/string.go:58:12: x.v.CompareAndSwap undefined (type Value has no field or method CompareAndSwap)
../../../go/pkg/mod/go.uber.org/[email protected]/string.go:64:12: x.v.Swap undefined (type Value has no field or method Swap)
note: module requires Go 1.18

Methods Swap and CompareAndSwap from atomic.Value were introduced in go1.17.

Bellow is a Dockerfile the issue can be reproduced with.
Playing with image tag from top you can see that on 1.16 error is encountered, on 1.18 everything works smoothly.

FROM golang:1.16.0-alpine3.13
# FROM golang:1.18.0-alpine3.15

RUN apk add --no-cache git

RUN git clone https://github.com/actforgood/xconf /xconf

WORKDIR /xconf

CMD ["go", "get", "go.uber.org/[email protected]"]
docker build -q -f Dockerfile -t test_upgrade .
docker run --name test_container test_upgrade
docker rm test_container
docker image rm test_upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions