From 5fead5dfe8b231e0b731281fce3e87d002300601 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:01:30 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/samber/slog-logrus/v2 from 2.5.0 to 2.5.1 Bumps [github.com/samber/slog-logrus/v2](https://github.com/samber/slog-logrus) from 2.5.0 to 2.5.1. - [Release notes](https://github.com/samber/slog-logrus/releases) - [Commits](https://github.com/samber/slog-logrus/compare/v2.5.0...v2.5.1) --- updated-dependencies: - dependency-name: github.com/samber/slog-logrus/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 9 ++++++--- go.sum | 12 ++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 822cb69..dd3c13a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/grafana/clireadme v0.1.0 github.com/grafana/k6lint v0.3.2 github.com/narqo/go-badge v0.0.0-20230821190521-c9a75c019a59 - github.com/samber/slog-logrus/v2 v2.5.0 + github.com/samber/slog-logrus/v2 v2.5.1 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.1 github.com/xeipuuv/gojsonschema v1.2.0 @@ -29,6 +29,7 @@ require ( github.com/cli/shurcooL-graphql v0.0.4 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-minhash v0.0.0-20190315135803-ad340ca03076 // indirect github.com/ekzhu/minhash-lsh v0.0.0-20190924033628-faac2c6342f8 // indirect github.com/emirpasic/gods v1.18.1 // indirect @@ -55,15 +56,17 @@ require ( github.com/muesli/termenv v0.15.2 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/samber/lo v1.44.0 // indirect - github.com/samber/slog-common v0.17.0 // indirect + github.com/samber/lo v1.47.0 // indirect + github.com/samber/slog-common v0.18.0 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/shogo82148/go-shuffle v1.0.1 // indirect github.com/skeema/knownhosts v1.2.2 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect diff --git a/go.sum b/go.sum index 0fd61bf..d9173e2 100644 --- a/go.sum +++ b/go.sum @@ -141,12 +141,12 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/samber/lo v1.44.0 h1:5il56KxRE+GHsm1IR+sZ/6J42NODigFiqCWpSc2dybA= -github.com/samber/lo v1.44.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= -github.com/samber/slog-common v0.17.0 h1:HdRnk7QQTa9ByHlLPK3llCBo8ZSX3F/ZyeqVI5dfMtI= -github.com/samber/slog-common v0.17.0/go.mod h1:mZSJhinB4aqHziR0SKPqpVZjJ0JO35JfH+dDIWqaCBk= -github.com/samber/slog-logrus/v2 v2.5.0 h1:0R1QlxBApEX6GOdCulqvDbeOK09LCSUDSEjVvm5ZeD4= -github.com/samber/slog-logrus/v2 v2.5.0/go.mod h1:xN6h40pDGXSJDgZsttF9KtaIV7dtpjeoBDpw8TpvRr8= +github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc= +github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU= +github.com/samber/slog-common v0.18.0 h1:zPeXHM+WhMl2zSx76Rg3EE0jwXdkut9s45K+pwhcO1c= +github.com/samber/slog-common v0.18.0/go.mod h1:6Krf+hemckfEiRDqy3J/sTpKTJQvmOoFLj9Riz3IkRU= +github.com/samber/slog-logrus/v2 v2.5.1 h1:f4YBejVz85E7AC7Pr0Hd5vx1EnLMPdxN1d3a3+7VRNE= +github.com/samber/slog-logrus/v2 v2.5.1/go.mod h1:EcE7NMudrRQO4wzPI0BKP4iuy/c5EIzPr5HbX4z+plY= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shogo82148/go-shuffle v0.0.0-20180218125048-27e6095f230d/go.mod h1:2htx6lmL0NGLHlO8ZCf+lQBGBHIbEujyywxJArf+2Yc= From 27882f28721b6a675e4ff7eb50c95b1963aa1212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Mon, 6 Jan 2025 15:09:21 +0100 Subject: [PATCH 2/2] update golangci-lint to 1.63.4 --- .github/workflows/lint.yml | 2 +- .golangci.yml | 56 +++++++++++++++++++------------------- metrics.go | 6 ++-- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 33ec4d3..c9bb825 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,6 +31,6 @@ jobs: - name: Go linter uses: golangci/golangci-lint-action@v6 with: - version: v1.57.2 + version: v1.63.4 args: --timeout=60m install-mode: binary diff --git a/.golangci.yml b/.golangci.yml index b8b20f5..894eea1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,4 @@ -# v1.57.2 +# v1.63.4 # Please don't remove the first line. It uses in CI to determine the golangci version run: timeout: 5m @@ -15,32 +15,32 @@ issues: exclude-use-default: false exclude-rules: - # Exclude duplicate code and function length and complexity checking in test - # files (due to common repeats and long functions in test code) - - path: _(test|gen)\.go - linters: - - cyclop - - dupl - - gocognit - - funlen - - lll - - forcetypeassert - - path: js\/modules\/k6\/html\/.*\.go - text: "exported: exported " - linters: - - revive - - path: js\/modules\/k6\/http\/.*_test\.go - linters: - # k6/http module's tests are quite complex because they often have several nested levels. - # The module is in maintainance mode, so we don't intend to port the tests to a parallel version. - - paralleltest - - tparallel - - linters: - - staticcheck # Tracked in https://github.com/grafana/xk6-grpc/issues/14 - text: "The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated." - - linters: - - forbidigo - text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden' + # Exclude duplicate code and function length and complexity checking in test + # files (due to common repeats and long functions in test code) + - path: _(test|gen)\.go + linters: + - cyclop + - dupl + - gocognit + - funlen + - lll + - forcetypeassert + - path: js\/modules\/k6\/html\/.*\.go + text: "exported: exported " + linters: + - revive + - path: js\/modules\/k6\/http\/.*_test\.go + linters: + # k6/http module's tests are quite complex because they often have several nested levels. + # The module is in maintainance mode, so we don't intend to port the tests to a parallel version. + - paralleltest + - tparallel + - linters: + - staticcheck # Tracked in https://github.com/grafana/xk6-grpc/issues/14 + text: "The entire proto file grpc/reflection/v1alpha/reflection.proto is marked as deprecated." + - linters: + - forbidigo + text: 'use of `os\.(SyscallError|Signal|Interrupt)` forbidden' linters-settings: exhaustive: @@ -81,7 +81,7 @@ linters: - errname - errorlint - exhaustive - - exportloopref + - copyloopvar - forbidigo - forcetypeassert - funlen diff --git a/metrics.go b/metrics.go index 7673c2d..87c5e65 100644 --- a/metrics.go +++ b/metrics.go @@ -187,11 +187,11 @@ func (m *Metrics) WritePrometheus(out io.Writer, namePrefix string, helpPrefix s fullname := namePrefix + name if help, hasHelp := metricsHelps[name]; hasHelp { - fmt.Fprintf(out, "# HELP %s %s\n", fullname, helpPrefix+help) + fmt.Fprintf(out, "# HELP %s %s\n", fullname, helpPrefix+help) //nolint:errcheck } - fmt.Fprintf(out, "# TYPE %s counter\n", fullname) - fmt.Fprintf(out, "%s %d %d\n\n", fullname, value, now) + fmt.Fprintf(out, "# TYPE %s counter\n", fullname) //nolint:errcheck + fmt.Fprintf(out, "%s %d %d\n\n", fullname, value, now) //nolint:errcheck } return nil