From b499b7cc2b9f92dbddeab58021184ef8a64ed1fc Mon Sep 17 00:00:00 2001 From: Sourabh Mehta Date: Wed, 6 Nov 2024 09:26:38 +0100 Subject: [PATCH] Fix: Linter issue with non-constant format string --- .github/workflows/eventlist.yml | 12 +++++++++--- tools/eventlist/.golangci.yaml | 2 +- tools/eventlist/pkg/output/output.go | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/eventlist.yml b/.github/workflows/eventlist.yml index 5e7502a..a30cda0 100644 --- a/.github/workflows/eventlist.yml +++ b/.github/workflows/eventlist.yml @@ -197,12 +197,18 @@ jobs: - name: Install go-junit-report run: go install github.com/jstemmer/go-junit-report/v2@latest + - name: Run unit test-TEMP + run: | + go test -v ./... + working-directory: ./tools/eventlist + - name: Run unit test run: | go test -v 2>&1 ./... | go-junit-report -set-exit-code > build/evenlistunittest-${{ matrix.os }}.xml working-directory: ./tools/eventlist - name: Archive unit test results + if: always() uses: actions/upload-artifact@v3 with: name: unit-test-result-${{ matrix.os }} @@ -264,15 +270,15 @@ jobs: - name: Check coverage run: | go test ./... -race -coverprofile=build/cover.out -covermode=atomic - test `go tool cover -func build/cover.out | tail -1 | awk '{print ($3 + 0)*10}'` -gt 980 + test `go tool cover -func build/cover.out | tail -1 | awk '{print ($3 + 0)*10}'` -gt 950 working-directory: ./tools/eventlist - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./tools/eventlist/build/cover.out fail_ci_if_error: true - functionalities: fix + verbose: true release: needs: [ build, test, coverage ] diff --git a/tools/eventlist/.golangci.yaml b/tools/eventlist/.golangci.yaml index d3cddda..2488b03 100644 --- a/tools/eventlist/.golangci.yaml +++ b/tools/eventlist/.golangci.yaml @@ -2,7 +2,7 @@ linters: enable: - errname - errorlint - - goerr113 + - err113 - makezero - nilerr - paralleltest diff --git a/tools/eventlist/pkg/output/output.go b/tools/eventlist/pkg/output/output.go index 6744886..5cce045 100644 --- a/tools/eventlist/pkg/output/output.go +++ b/tools/eventlist/pkg/output/output.go @@ -367,7 +367,7 @@ func (o *Output) printStatistic(out *bufio.Writer, eventCount int, eventTable *E TextMaxB: o.evProps[i].values[j].textMaxB, TextMaxE: o.evProps[i].values[j].textMaxE, } - err = conditionalWrite(out, eventStat.Event) + err = conditionalWrite(out, "%s", eventStat.Event) if err == nil && j < 10 { err = conditionalWrite(out, " ") }