Skipper: Errors while installing skipper when using 'go get github.com/zalando/skipper/...

Created on 12 Sep 2019  路  5Comments  路  Source: zalando/skipper

Describe the bug
After creating a Go workspace. When I'm trying to get the skipper packages I'm getting these errors

go get github.com/zalando/skipper/...
src/github.com/zalando/skipper/ratelimit/redis.go:165:26: cannot use redis.Z literal (type redis.Z) as type *redis.Z in argument to c.ring.cmdable.ZAdd
src/github.com/zalando/skipper/ratelimit/redis.go:210:59: cannot use redis.ZRangeBy literal (type redis.ZRangeBy) as type *redis.ZRangeBy in argument to c.ring.cmdable.ZRangeByScoreWithScores

I would highly appreciate if someone can update me if this is a problem with skipper or a local issue. Thank you

Most helpful comment

Yes, true skipper use go modules.

Interesting that go 1.13 does not work as default. As far as I know go 1.13 has go modules enabled by default.

All 5 comments

@divyeshjethwa what Go version do you run?

I run Go 1.13

I tested with a clean GOPATH:
[/tmp]% mkdir gopath
[/tmp]% GOPATH=/tmp/gopath go get github.com/zalando/skipper/...
go: finding github.com/zalando/skipper v0.10.286
go: downloading github.com/zalando/skipper v0.10.286
go: extracting github.com/zalando/skipper v0.10.286
go: downloading github.com/cenkalti/backoff v2.2.1+incompatible
...
go: finding github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743
go: finding google.golang.org/grpc v1.22.0
go: finding google.golang.org/genproto v0.0.0-20190530194941-fb225487d101
[/tmp]%
```

Hi @szuecs, I tried with docker and a Dockerfile like:

FROM golang:1.13.0

RUN go get github.com/zalando/skipper/...

CMD ["skipper"]

And I can confirm that the same error is displayed and the image fail to build.

Fixed by activating go modules with GO111MODULE=on:

FROM golang:1.13.0

RUN GO111MODULE=on go get github.com/zalando/skipper/...

CMD ["skipper"]

Yes, true skipper use go modules.

Interesting that go 1.13 does not work as default. As far as I know go 1.13 has go modules enabled by default.

@rbarilani I can confirm that the docker build does not work:

% cat > Dockerfile
FROM golang:1.13.0
RUN go get github.com/zalando/skipper/...
CMD ["skipper"]
% docker build .
Sending build context to Docker daemon  2.048kB
Step 1/3 : FROM golang:1.13.0
1.13.0: Pulling from library/golang
4a56a430b2ba: Pull complete
4b5cacb629f5: Pull complete
14408c8d4f9a: Pull complete
ea67eaa7dd42: Pull complete
a2a2197e145e: Pull complete
36ac8c11a11f: Pull complete
ecd7d9a67e26: Pull complete
Digest: sha256:90d554b5ae59cb63d2bf42bdfcd60aa1feb4794d9e3a9cbb9d2deb477c088be0
Status: Downloaded newer image for golang:1.13.0
 ---> c4d6fdf2260a
Step 2/3 : RUN go get github.com/zalando/skipper/...
 ---> Running in c0a6c81b5c30
# github.com/zalando/skipper/ratelimit
src/github.com/zalando/skipper/ratelimit/redis.go:165:26: cannot use redis.Z literal (type redis.Z) as type *redis.Z in argument to c.ring.cmdable.ZAdd
src/github.com/zalando/skipper/ratelimit/redis.go:210:59: cannot use redis.ZRangeBy literal (type redis.ZRangeBy) as type *redis.ZRangeBy in argument to c.ring.cmdable.ZRangeByScoreWithScores
The command '/bin/sh -c go get github.com/zalando/skipper/...' returned a non-zero code: 2
zsh: exit 2     docker build .

The docs reflect how to build the project and also the docker container so I would close the issue

Was this page helpful?
0 / 5 - 0 ratings