uber-go / uber-go/atomic

cannot upgrade package to v1.10.0

Open
#120 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
1.5k
Forks
116
Avg merge
7d 10h
Merged PRs (30d)
4

Description

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/atomic@v1.10.0/error.go:55:12: x.v.CompareAndSwap undefined (type Value has no field or method CompareAndSwap)
../../../go/pkg/mod/go.uber.org/atomic@v1.10.0/error.go:61:24: x.v.Swap undefined (type Value has no field or method Swap)
../../../go/pkg/mod/go.uber.org/atomic@v1.10.0/string.go:58:12: x.v.CompareAndSwap undefined (type Value has no field or method CompareAndSwap)
../../../go/pkg/mod/go.uber.org/atomic@v1.10.0/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/atomic@v1.10.0"]
docker build -q -f Dockerfile -t test_upgrade .
docker run --name test_container test_upgrade
docker rm test_container
docker image rm test_upgrade

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the go.mod requirements for v1.9.0 and v1.10.0, then reproduce the failure with the Dockerfile and Go 1.16 image described in the issue. Review the reported atomic.Value errors and determine what compatibility or release-policy decision is needed; done means the issue has a documented resolution and the relevant version behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.