bump up golang version

upgrade go version to v1.18.8

Signed-off-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
Wang Yan 2022-11-29 22:42:26 +08:00 committed by Sebastiaan van Stijn
parent db1389e043
commit 70db3a46d9
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
8 changed files with 11 additions and 17 deletions

View file

@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17.*
go-version: 1.18.8
- name: Dependencies
run: |
@ -39,7 +39,7 @@ jobs:
DCO_VERBOSITY=-q script/validate/dco
GO111MODULE=on script/setup/install-dev-tools
script/validate/vendor
go build -i .
go build .
make check
make build
make binaries

View file

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG GO_VERSION=1.17
ARG GO_VERSION=1.18.8
ARG ALPINE_VERSION=3.16
ARG XX_VERSION=1.1.1

View file

@ -50,7 +50,7 @@ version/version.go:
check: ## run all linters (TODO: enable "unused", "varcheck", "ineffassign", "unconvert", "staticheck", "goimports", "structcheck")
@echo "$(WHALE) $@"
golangci-lint run
@GO111MODULE=off golangci-lint run
test: ## run tests, except integration test with test.short
@echo "$(WHALE) $@"

View file

@ -246,11 +246,7 @@ func (ctx *muxVarsContext) Value(key interface{}) interface{} {
return ctx.vars
}
if strings.HasPrefix(keyStr, "vars.") {
keyStr = strings.TrimPrefix(keyStr, "vars.")
}
if v, ok := ctx.vars[keyStr]; ok {
if v, ok := ctx.vars[strings.TrimPrefix(keyStr, "vars.")]; ok {
return v
}
}

View file

@ -17,4 +17,4 @@ RUN wget https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz --quiet && \
tar -C /usr/local -xzf go$GOLANG_VERSION.linux-amd64.tar.gz && \
rm go${GOLANG_VERSION}.linux-amd64.tar.gz
RUN go get github.com/axw/gocov/gocov github.com/mattn/goveralls github.com/golang/lint/golint
RUN go install github.com/axw/gocov/gocov@latest github.com/mattn/goveralls@latest github.com/golang/lint/golint@latest

View file

@ -114,9 +114,7 @@ func (r *registry) Repositories(ctx context.Context, entries []string, last stri
return 0, err
}
for cnt := range ctlg.Repositories {
entries[cnt] = ctlg.Repositories[cnt]
}
copy(entries, ctlg.Repositories)
numFilled = len(ctlg.Repositories)
link := resp.Header.Get("Link")

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
GOLANGCI_LINT_VERSION="v1.27.0"
GOLANGCI_LINT_VERSION="v1.50.1"
#
# Install developer tools to $GOBIN (or $GOPATH/bin if unset)
@ -8,5 +8,5 @@ GOLANGCI_LINT_VERSION="v1.27.0"
set -eu -o pipefail
cd /tmp
go get -u github.com/LK4D4/vndr
go get "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}"
go install github.com/LK4D4/vndr@latest
go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}"

View file

@ -17,7 +17,7 @@ var Package = "$(go list)"
// Version indicates which version of the binary is running. This is set to
// the latest release tag by hand, always suffixed by "+unknown". During
// build, it will be replaced by the actual version. The value here will be
// used if the registry is run after a go get based install.
// used if the registry is run after a go install based install.
var Version = "$(git describe --match 'v[0-9]*' --dirty='.m' --always)+unknown"
// Revision is filled with the VCS (e.g. git) revision being used to build