From f0f47640120ca1d4460c2970d5660ccad4034394 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 4 Oct 2022 13:05:53 +0200 Subject: [PATCH] fix formatting of nolint tags Also replacing some of them, as there's more linters that check for this now (revive being one of them), so "fixing" them prevents having to add more linters to the list. Signed-off-by: Sebastiaan van Stijn --- assert/cmd/gty-migrate-from-testify/call.go | 3 +-- assert/cmp/compare.go | 2 +- fs/file.go | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/assert/cmd/gty-migrate-from-testify/call.go b/assert/cmd/gty-migrate-from-testify/call.go index 9ebb093..d515a42 100644 --- a/assert/cmd/gty-migrate-from-testify/call.go +++ b/assert/cmd/gty-migrate-from-testify/call.go @@ -22,8 +22,7 @@ type call struct { func (c call) String() string { buf := new(bytes.Buffer) - //nolint: errcheck - format.Node(buf, token.NewFileSet(), c.expr) + _ = format.Node(buf, token.NewFileSet(), c.expr) return buf.String() } diff --git a/assert/cmp/compare.go b/assert/cmp/compare.go index fce073b..4112b00 100644 --- a/assert/cmp/compare.go +++ b/assert/cmp/compare.go @@ -249,7 +249,7 @@ type causer interface { } func formatErrorMessage(err error) string { - //nolint: errorlint // unwrapping is not appropriate here + //nolint:errorlint // unwrapping is not appropriate here if _, ok := err.(causer); ok { return fmt.Sprintf("%q\n%+v", err, err) } diff --git a/fs/file.go b/fs/file.go index 1db8c5e..eb8e301 100644 --- a/fs/file.go +++ b/fs/file.go @@ -72,8 +72,7 @@ func (f *File) Path() string { // Remove the file func (f *File) Remove() { - //nolint: errcheck - os.Remove(f.path) + _ = os.Remove(f.path) } // Dir is a temporary directory @@ -106,8 +105,7 @@ func (d *Dir) Path() string { // Remove the directory func (d *Dir) Remove() { - //nolint: errcheck - os.RemoveAll(d.path) + _ = os.RemoveAll(d.path) } // Join returns a new path with this directory as the base of the path