From 3cd999bb8750cfabaff30330f50e82774c2a310a Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Mon, 28 Mar 2022 14:18:55 +1100 Subject: [PATCH] Bumping to go1.18, bumping dev tools --- .github/workflows/go.yml | 4 ++-- .github/workflows/release.yml | 2 +- go.mod | 2 +- go.sum | 4 ---- pkg/yqlib/expression_postfix.go | 2 +- pkg/yqlib/file_utils.go | 2 +- scripts/devtools.sh | 4 ++-- scripts/format.sh | 1 - snap/snapcraft.yaml | 2 +- 9 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 4f425ef4..f38b3647 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.17 + - name: Set up Go 1.18 uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 id: go - name: Check out code into the Go module directory diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 442efc82..8736c2ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v2 with: - go-version: '^1.17.5' + go-version: '^1.18' - name: Compile man page markup id: gen-man-page-md run: | diff --git a/go.mod b/go.mod index 8feb4f35..00644d77 100644 --- a/go.mod +++ b/go.mod @@ -26,4 +26,4 @@ require ( golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect ) -go 1.17 +go 1.18 diff --git a/go.sum b/go.sum index 989a94a0..53c77580 100644 --- a/go.sum +++ b/go.sum @@ -54,16 +54,12 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d h1:FjkYO/PPp4Wi0EAUOVLxePm7qVW4r4ctbWpURyuOD0E= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/yqlib/expression_postfix.go b/pkg/yqlib/expression_postfix.go index 46783509..6b82e153 100644 --- a/pkg/yqlib/expression_postfix.go +++ b/pkg/yqlib/expression_postfix.go @@ -50,7 +50,7 @@ func (p *expressionPostFixerImpl) ConvertToPostfix(infixTokens []*token) ([]*Ope log.Debugf("put %v onto the opstack", currentToken.toString(true)) case closeCollect, closeCollectObject: var opener tokenType = openCollect - var collectOperator *operationType = collectOpType + var collectOperator = collectOpType if currentToken.TokenType == closeCollectObject { opener = openCollectObject collectOperator = collectObjectOpType diff --git a/pkg/yqlib/file_utils.go b/pkg/yqlib/file_utils.go index 470aead7..307e4591 100644 --- a/pkg/yqlib/file_utils.go +++ b/pkg/yqlib/file_utils.go @@ -39,7 +39,7 @@ func copyFileContents(src, dst string) (err error) { return err } defer safelyCloseFile(in) - out, err := os.Create(dst) + out, err := os.Create(dst) // #nosec if err != nil { return err } diff --git a/scripts/devtools.sh b/scripts/devtools.sh index 89c895c3..278bcc7d 100755 --- a/scripts/devtools.sh +++ b/scripts/devtools.sh @@ -1,5 +1,5 @@ #!/bin/sh set -ex go mod download golang.org/x/tools@latest -wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.43.0 -wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.9.1 +curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2 +wget -O- -nv https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s v2.11.0 diff --git a/scripts/format.sh b/scripts/format.sh index 0a11c952..2faf7a7d 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -1,6 +1,5 @@ #!/bin/bash -find . \( -path ./vendor \) -prune -o -name "*.go" -exec goimports -w {} \; gofmt -w -s . go mod tidy go mod vendor diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 3e7f5de3..80d331a8 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -16,7 +16,7 @@ apps: parts: yq: plugin: go - go-channel: 1.17/stable + go-channel: 1.18/stable source: . source-type: git go-importpath: github.com/mikefarah/yq