viant/endly

Test failed with go mod

sagarafr opened this issue · 2 comments

Hello,
I'm using go mod feature and I have some trouble, when I'm using viant/endly. Indeed, this is a simple Dockerfile :

FROM golang:1.11

ENV GO111MODULE on
RUN mkdir -p ${GOPATH}/src/github.com/viant/
WORKDIR ${GOPATH}/src/github.com/viant
RUN git clone https://github.com/viant/endly
WORKDIR ${GOPATH}/src/github.com/viant/endly
RUN go mod init
RUN go mod tidy
RUN go test -coverprofile=cover.out

Expected output

PASS
coverage: XX% of statements
ok      github.com/viant/endly       XXXs

Output

# github.com/viant/endly [github.com/viant/endly.test]
./context.go:297: assignment mismatch: 2 variables but 1 values
./manager.go:98: assignment mismatch: 2 variables but 1 values
FAIL	github.com/viant/endly [build failed]
The command '/bin/sh -c go test -coverprofile=cover.out' returned a non-zero code: 2

Possible fix

  • Fix a version of github.com/satori/go.uuid, when this function uuid.NewV1() return UUID and error
  • Update the code with UUID := uuid.NewV1() and get the updated version of github.com/satori/go.uuid

Added go.mod with endly dependencies to address an issue with the older UUID version,
also to build endly binary you need to add the following to your docker file

RUN go test -coverprofile=cover.out
WORKDIR ${GOPATH}/src/github.com/viant/endly/endly
RUN go build endly.go

Hi,
Thanks you for your quick response 😃
I post at the end the final Dockerfile :

FROM golang:1.11

ENV GO111MODULE on
RUN mkdir -p ${GOPATH}/src/github.com/viant/
WORKDIR ${GOPATH}/src/github.com/viant
RUN git clone https://github.com/viant/endly
WORKDIR ${GOPATH}/src/github.com/viant/endly
RUN go test -coverprofile=cover.out
WORKDIR ${GOPATH}/src/github.com/viant/endly/endly
RUN go build endly.go
RUN cp endly /usr/local/bin

And close the issue