From 372c3e746e45208b3c3abe20c7033d4e7f99bfc8 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 13 Apr 2024 17:37:49 +0100 Subject: [PATCH] lint: enable staticcheck and fix problems --- .golangci.yml | 2 +- s3mem/backend.go | 6 +++--- xml/marshal_test.go | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 2cd0f29..367e175 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -8,7 +8,7 @@ linters: - ineffassign - govet - unconvert - #- staticcheck + - staticcheck - gosimple - stylecheck - unused diff --git a/s3mem/backend.go b/s3mem/backend.go index 435f1eb..d14d421 100644 --- a/s3mem/backend.go +++ b/s3mem/backend.go @@ -320,9 +320,9 @@ func (db *Backend) DeleteMulti(ctx context.Context, bucketName string, objects . if err != nil { errres := gofakes3.ErrorResultFromError(err) - if errres.Code == gofakes3.ErrInternal { - // FIXME: log - } + // if errres.Code == gofakes3.ErrInternal { + // // FIXME: log + // } result.Error = append(result.Error, errres) diff --git a/xml/marshal_test.go b/xml/marshal_test.go index 08bfe05..2c5f5ca 100644 --- a/xml/marshal_test.go +++ b/xml/marshal_test.go @@ -1698,6 +1698,7 @@ func TestMarshal(t *testing.T) { } type AttrParent struct { + //nolint:staticcheck // FIXME invalid XML tag: X>Y chain not valid with attr flag X string `xml:"X>Y,attr"` } @@ -2494,6 +2495,7 @@ func TestIssue16158(t *testing.T) { type InvalidXMLName struct { XMLName Name `xml:"error"` Type struct { + //nolint:staticcheck // FIXME invalid XML tag: cannot use option attr on XMLName field XMLName Name `xml:"type,attr"` } }