From f9979879a15f242294d65147ac0012ffadaeba0d Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 25 Mar 2022 23:16:24 +1100 Subject: [PATCH] no more naked returns --- .golangci.yml | 5 +++++ pkg/commands/oscommands/copy.go | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 358a5d12a..de90dc516 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -13,6 +13,7 @@ linters: - unconvert - exhaustive - makezero + - nakedret # - goconst # TODO: enable and fix issues fast: false @@ -20,5 +21,9 @@ linters-settings: exhaustive: default-signifies-exhaustive: true + nakedret: + # the gods will judge me but I just don't like naked returns at all + max-func-lines: 0 + run: go: 1.18 diff --git a/pkg/commands/oscommands/copy.go b/pkg/commands/oscommands/copy.go index 131e9bc6b..f68590280 100644 --- a/pkg/commands/oscommands/copy.go +++ b/pkg/commands/oscommands/copy.go @@ -72,7 +72,7 @@ func CopyFile(src, dst string) (err error) { return } - return + return //nolint: nakedret } // CopyDir recursively copies a directory tree, attempting to preserve permissions. @@ -133,5 +133,5 @@ func CopyDir(src string, dst string) (err error) { } } - return + return //nolint: nakedret }