Merge pull request #1959 from nspcc-dev/drop-vendoring

Drop vendoring, fix jsonpath lint
This commit is contained in:
Roman Khimov 2021-05-13 17:54:39 +03:00 committed by GitHub
commit fcf29bc093
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 21 deletions

View file

@ -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"]

View file

@ -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 \

1
go.sum
View file

@ -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=

View file

@ -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 {