diff --git a/.buildkite/hooks/post-checkout b/.buildkite/hooks/post-checkout index 67ae214..e10f15d 100644 --- a/.buildkite/hooks/post-checkout +++ b/.buildkite/hooks/post-checkout @@ -47,7 +47,7 @@ MERGE_BRANCH="pr_merge_${PR_ID}" checkout_merge "${TARGET_BRANCH}" "${PR_COMMIT}" "${MERGE_BRANCH}" echo "Commit information" -git log --format=%B -n 1 +git --no-pager log --format=%B -n 1 # Ensure buildkite groups are rendered echo "" diff --git a/.buildkite/scripts/bench.sh b/.buildkite/scripts/bench.sh index 47511ad..8258663 100755 --- a/.buildkite/scripts/bench.sh +++ b/.buildkite/scripts/bench.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euxo pipefail -go get -d -t ./... go mod download +go mod verify go test -count=5 -benchmem -run=XXX -benchtime=100ms -bench='.*' -v $(go list ./... | grep -v /vendor/) | tee bench.out diff --git a/.buildkite/scripts/test.sh b/.buildkite/scripts/test.sh index 7cc250c..1bbf41b 100755 --- a/.buildkite/scripts/test.sh +++ b/.buildkite/scripts/test.sh @@ -2,7 +2,6 @@ set -euxo pipefail go install github.com/elastic/go-licenser@latest -go get -d -t ./... go mod download go mod verify diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 986aa6f..11ec181 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -10,24 +10,21 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Read .go-version file id: goversion run: echo "version=$(cat .go-version)" >> $GITHUB_OUTPUT - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: go-version: "${{ steps.goversion.outputs.version }}" - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: - version: v1.44.2 + version: v1.54.2 args: --timeout=5m # Ignore pre-existing issues. only-new-issues: true - - # Use the Go version specified in .go-version for consistency. - skip-go-installation: true diff --git a/.go-version b/.go-version index 622f042..3500250 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -1.17.6 +1.21.0 diff --git a/.golangci.yml b/.golangci.yml index c5fc9d4..6926c02 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,7 +18,6 @@ linters: - typecheck - unused - varcheck - - depguard - errorlint - gofumpt - goimports diff --git a/auparse/auparse.go b/auparse/auparse.go index 5a65cc6..951720a 100644 --- a/auparse/auparse.go +++ b/auparse/auparse.go @@ -334,6 +334,7 @@ func extractKeyValuePairs(msg string) fieldMap { func trimQuotesAndSpace(v string) string { return strings.Trim(v, `'" `) } // Enrichment after KV parsing. +// //nolint:errcheck // Continue enriching even if some fields do not exist. func (m *AuditMessage) enrichData(data fieldMap) error { data.normalizeUnsetID("auid") diff --git a/go.mod b/go.mod index 6de4789..3b3bb83 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,6 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/stretchr/testify v1.7.0 go.uber.org/multierr v1.7.0 - golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 - gopkg.in/yaml.v2 v2.3.0 + golang.org/x/sys v0.11.0 + gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index c831254..d076ada 100644 --- a/go.sum +++ b/go.sum @@ -13,12 +13,12 @@ go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=