From dac3a657d277502c4a40013f4dbced994997c720 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Fri, 2 Jun 2023 16:35:17 +0200 Subject: [PATCH] chore: update linter (#1927) --- .github/workflows/pr.yml | 2 +- .golangci.yml | 23 ++++++++++++++++++----- acme/api/api.go | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e92b3d87..aac592ee 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest env: GO_VERSION: '1.20' - GOLANGCI_LINT_VERSION: v1.52.2 + GOLANGCI_LINT_VERSION: v1.53.1 HUGO_VERSION: 0.54.0 CGO_ENABLED: 0 LEGO_E2E_TESTS: CI diff --git a/.golangci.yml b/.golangci.yml index f8259a09..b8c1be2d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,11 +20,23 @@ linters-settings: ignore-words: - internetbs depguard: - list-type: denylist - include-go-root: false - packages: - - github.com/pkg/errors - - github.com/instana/testify + rules: + main: + deny: + - pkg: "github.com/instana/testify" + desc: not allowed + - pkg: "github.com/pkg/errors" + desc: Should be replaced by standard lib errors package + tagalign: + align: false + order: + - xml + - json + - yaml + - yml + - toml + - mapstructure + - url godox: keywords: - FIXME @@ -124,6 +136,7 @@ linters: - errchkjson - nonamedreturns - musttag # false-positive https://github.com/junk1tm/musttag/issues/17 + - gosmopolitan # not relevant issues: exclude-use-default: false diff --git a/acme/api/api.go b/acme/api/api.go index 69dda009..b8c9cf0c 100644 --- a/acme/api/api.go +++ b/acme/api/api.go @@ -117,7 +117,7 @@ func (a *Core) signedPost(uri string, content []byte, response interface{}) (*ht return nil, fmt.Errorf("failed to post JWS message: failed to sign content: %w", err) } - signedBody := bytes.NewBuffer([]byte(signedContent.FullSerialize())) + signedBody := bytes.NewBufferString(signedContent.FullSerialize()) resp, err := a.doer.Post(uri, signedBody, "application/jose+json", response)