From d6364739c532a65613d45b8cc7bb8dc6420c1400 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 13 May 2021 17:16:27 +0300 Subject: [PATCH 1/4] Dockerfile: use make to build neo-go Don't duplicate go build invocation line there. --- Dockerfile | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7dd749887..e2c4747fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM golang:1-alpine as builder RUN set -x \ - && apk add --no-cache git \ + && apk add --no-cache git make \ && mkdir -p /tmp COPY . /neo-go @@ -12,14 +12,7 @@ WORKDIR /neo-go ARG REPO=repository ARG VERSION=dev -# https://github.com/golang/go/wiki/Modules#how-do-i-use-vendoring-with-modules-is-vendoring-going-away -# go build -mod=vendor -RUN set -x \ - && export GOGC=off \ - && export GO111MODULE=on \ - && export CGO_ENABLED=0 \ - && export LDFLAGS="-X ${REPO}/pkg/config.Version=${VERSION}" \ - && go build -trimpath -v -mod=vendor -ldflags "${LDFLAGS}" -o /go/bin/neo-go ./cli +RUN make build # Executable image FROM alpine @@ -31,7 +24,7 @@ WORKDIR / COPY --from=builder /neo-go/config /config COPY --from=builder /neo-go/.docker/privnet-entrypoint.sh /usr/bin/privnet-entrypoint.sh -COPY --from=builder /go/bin/neo-go /usr/bin/neo-go +COPY --from=builder /neo-go/bin/neo-go /usr/bin/neo-go COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ ENTRYPOINT ["/usr/bin/privnet-entrypoint.sh"] From db4bd28160c31a2b95003bc7640ca34866d0846b Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 13 May 2021 17:22:10 +0300 Subject: [PATCH 2/4] Makefile: drop vendoring It's not really needed. --- Makefile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 4ea0dc735..e84bfcafd 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ build: deps @set -x \ && export GOGC=off \ && export CGO_ENABLED=0 \ - && go build -trimpath -v -mod=vendor -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go + && go build -trimpath -v -ldflags $(BUILD_FLAGS) -o ${BINARY} ./cli/main.go neo-go.service: neo-go.service.template @sed -r -e 's_BINDIR_$(BINDIR)_' -e 's_UNITWORKDIR_$(UNITWORKDIR)_' -e 's_SYSCONFIGDIR_$(SYSCONFIGDIR)_' $< >$@ @@ -68,8 +68,10 @@ check-version: git fetch && (! git rev-list ${VERSION}) deps: - @go mod tidy -v - @go mod vendor + @CGO_ENABLED=0 \ + go mod download + @CGO_ENABLED=0 \ + go mod tidy -v push-tag: git checkout ${BRANCH} @@ -94,13 +96,7 @@ cover: @go tool cover -html=coverage.txt -o coverage.html # --- Environment --- -env_vendor: - @echo "=> Update vendor" - @go mod tidy - @go mod download - @go mod vendor - -env_image: env_vendor +env_image: @echo "=> Building env image" @docker build \ -t env_neo_go_image \ From 186cfa32dfbb1abfa246f7b5c74713abb50b91ba Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 13 May 2021 17:22:30 +0300 Subject: [PATCH 3/4] go.sum: go mod tidy --- go.sum | 1 + 1 file changed, 1 insertion(+) diff --git a/go.sum b/go.sum index 48cc9472a..b01d2974d 100644 --- a/go.sum +++ b/go.sum @@ -269,6 +269,7 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAG golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 4131e208e5befb1a1e23eca637d272ed38c57457 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 13 May 2021 17:26:38 +0300 Subject: [PATCH 4/4] jsonpath: drop unnecessary assignment, fix lint fail pkg/services/oracle/jsonpath/jsonpath.go:354:8 ineffassign ineffectual assignment to val --- pkg/services/oracle/jsonpath/jsonpath.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/oracle/jsonpath/jsonpath.go b/pkg/services/oracle/jsonpath/jsonpath.go index 5672572a4..2fdaeb750 100644 --- a/pkg/services/oracle/jsonpath/jsonpath.go +++ b/pkg/services/oracle/jsonpath/jsonpath.go @@ -351,7 +351,7 @@ func (p *pathParser) processUnion(objs []interface{}, firstTyp pathTokenType, fi } items = append(items, val) - typ, val = p.nextToken() + typ, _ = p.nextToken() if typ == pathRightBracket { break } else if typ != pathComma {