From 642931c0d5bdc85d2dd4b5104a4f1e5e5b5c230e Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 17 Feb 2025 15:49:04 +0200 Subject: [PATCH] Remove no longer relevant fmtTags --- errcheck/errcheck.go | 2 +- errcheck/tags.go | 12 ------------ errcheck/tags_compat.go | 13 ------------- 3 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 errcheck/tags.go delete mode 100644 errcheck/tags_compat.go diff --git a/errcheck/errcheck.go b/errcheck/errcheck.go index a7a2a30..7ad74a4 100644 --- a/errcheck/errcheck.go +++ b/errcheck/errcheck.go @@ -162,7 +162,7 @@ var loadPackages = func(cfg *packages.Config, paths ...string) ([]*packages.Pack // LoadPackages loads all the packages in all the paths provided. It uses the // exclusions and build tags provided to by the user when loading the packages. func (c *Checker) LoadPackages(paths ...string) ([]*packages.Package, error) { - buildFlags := []string{fmtTags(c.Tags)} + buildFlags := []string{fmt.Sprintf("-tags=%s", strings.Join(c.Tags, ","))} if c.Mod != "" { buildFlags = append(buildFlags, fmt.Sprintf("-mod=%s", c.Mod)) } diff --git a/errcheck/tags.go b/errcheck/tags.go deleted file mode 100644 index 7b423ca..0000000 --- a/errcheck/tags.go +++ /dev/null @@ -1,12 +0,0 @@ -// +build go1.13 - -package errcheck - -import ( - "fmt" - "strings" -) - -func fmtTags(tags []string) string { - return fmt.Sprintf("-tags=%s", strings.Join(tags, ",")) -} diff --git a/errcheck/tags_compat.go b/errcheck/tags_compat.go deleted file mode 100644 index 2f534f4..0000000 --- a/errcheck/tags_compat.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build go1.11 -// +build !go1.13 - -package errcheck - -import ( - "fmt" - "strings" -) - -func fmtTags(tags []string) string { - return fmt.Sprintf("-tags=%s", strings.Join(tags, " ")) -}