Home > front end >  go-kit missing entry for module in go.sum
go-kit missing entry for module in go.sum

Time:01-14

I am working my way through a tutorial on go-kit which is using etcd for service discovery. I am using Goland to build a multi-container architecture locally and have just got to the bit where one service (notificator) is being registered in etcd.

All seems fine but when I run:

docker-compose up --build notificator

I get:

#12 7.248 /go/pkg/mod/github.com/go-kit/[email protected]/sd/etcd/client.go:13:2: missing go.sum entry for module providing package go.etcd.io/etcd/client/v2 (imported by github.com/go-kit/kit/sd/etcd); to add:
#12 7.248   go get github.com/go-kit/kit/sd/[email protected]

When I do run go get github.com/go-kit/kit/sd/[email protected] then rerun docker-compose up --build notificator the error persists even though go.sum contains the following:

go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ=
go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON GuvO6Z7lLS/oTh0=

go.mod is:

module notificator

go 1.15

require (
    github.com/go-kit/kit v0.12.0
    github.com/lightstep/lightstep-tracer-go v0.25.0
    github.com/oklog/oklog v0.3.2
    github.com/oklog/run v1.1.0 // indirect
    github.com/opentracing/basictracer-go v1.1.0 // indirect
    github.com/opentracing/opentracing-go v1.2.0
    github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5
    github.com/openzipkin/zipkin-go v0.3.0
    github.com/prometheus/client_golang v1.11.0
    golang.org/x/net v0.0.0-20211216030914-fe4d6282115f
    google.golang.org/grpc v1.43.0
    google.golang.org/protobuf v1.27.1
    sourcegraph.com/sourcegraph/appdash v0.0.0-20211028080628-e2786a622600
)

Not sure how to interpret that as it looks to me the condition is satisfied ?? I also thought that would have been automatically imported?

CodePudding user response:

This turns out to be an issue with my Dockerfile.

COPY go.mod .
COPY go.sum .
RUN go mod download

will produce the above error, while

COPY . .
RUN go get  -t -v ./...

does not. I am not entirely sure why so will open another question.

  •  Tags:  
  • Related