From 3be4a47a24b168aa3c12ac219f04c016ca44a5a4 Mon Sep 17 00:00:00 2001 From: Wim Date: Fri, 24 May 2024 23:12:11 +0200 Subject: [PATCH] Update to go1.22 --- .github/workflows/development.yml | 10 +++++----- .golangci.yaml | 31 ++++--------------------------- mm-go-irckit/service.go | 2 +- 3 files changed, 10 insertions(+), 33 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index e434fe43..72c2cc41 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -11,12 +11,12 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.55.0 + version: latest args: "-v --new-from-rev HEAD~5" test-build-upload: strategy: matrix: - go-version: [1.20.x, 1.21.x] + go-version: [1.21.x, 1.22.x] platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: @@ -38,19 +38,19 @@ jobs: GOOS=windows GOARCH=amd64 go build -mod=vendor -ldflags "-s -X main.githash=$(git log --pretty=format:'%h' -n 1)" -o output/win/matterircd-$VERSION-windows-amd64.exe GOOS=darwin GOARCH=amd64 go build -mod=vendor -ldflags "-s -X main.githash=$(git log --pretty=format:'%h' -n 1)" -o output/mac/matterircd-$VERSION-darwin-amd64 - name: Upload linux 64-bit - if: startsWith(matrix.go-version,'1.21') + if: startsWith(matrix.go-version,'1.22') uses: actions/upload-artifact@v3 with: name: matterircd-linux-64bit path: output/lin - name: Upload windows 64-bit - if: startsWith(matrix.go-version,'1.21') + if: startsWith(matrix.go-version,'1.22') uses: actions/upload-artifact@v3 with: name: matterircd-windows-64bit path: output/win - name: Upload darwin 64-bit - if: startsWith(matrix.go-version,'1.21') + if: startsWith(matrix.go-version,'1.22') uses: actions/upload-artifact@v3 with: name: matterircd-darwin-64bit diff --git a/.golangci.yaml b/.golangci.yaml index 48b93fca..204e06c5 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -23,7 +23,7 @@ run: # default value is empty list, but next dirs are always skipped independently # from this option's value: # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ - skip-dirs: gateway/bridgemap$ + issues.exclude-dirs: gateway/bridgemap$ # which files to skip: they will be analyzed, but issues from them # won't be reported. Default value is empty list, but there is @@ -35,7 +35,7 @@ run: # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" - format: colored-line-number + formats: colored-line-number # print lines of code with issue, default is true print-issued-lines: true @@ -55,9 +55,6 @@ linters-settings: # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; # default is false: such cases aren't reported by default. check-blank: false - govet: - # report about shadowed variables - check-shadowing: true golint: # minimal confidence for issues, default is 0.8 min-confidence: 0.8 @@ -130,39 +127,17 @@ linters-settings: # all checks list: https://github.com/go-critic/checkers # disabled for now - hugeParam enabled-checks: - - appendAssign - - assignOp - boolExprSimplify - builtinShadow - - captLocal - - caseOrder - commentedOutImport - - defaultCaseOrder - - dupArg - - dupBranchBody - - dupCase - - dupSubExpr - - elseif - emptyFallthrough - - ifElseChain - importShadow - indexAlloc - methodExprCall - nestingReduce - - offBy1 - ptrToRefParam - - regexpMust - - singleCaseSwitch - - sloppyLen - - switchTrue - - typeSwitchVar - typeUnparen - - underef - - unlambda - unnecessaryBlock - - unslice - - valSwap - - wrapperFunc - yodaStyleExpr @@ -223,6 +198,8 @@ linters: - gosmopolitan - zerologlint - tagalign + - mnd + - perfsprint # rules to deal with reported isues issues: diff --git a/mm-go-irckit/service.go b/mm-go-irckit/service.go index fe9e3472..fd8f4b25 100644 --- a/mm-go-irckit/service.go +++ b/mm-go-irckit/service.go @@ -436,7 +436,7 @@ func scrollback(u *User, toUser *User, args []string, service string) { } } - if !u.v.GetBool(u.br.Protocol() + ".collapsescrollback") { //nolint:goconst + if !u.v.GetBool(u.br.Protocol() + ".collapsescrollback") { u.MsgUser(toUser, fmt.Sprintf("scrollback results shown in %s", search)) } }