Repository: goreleaser/goreleaser
Pull request #2174 (2021-04-19 00:05:22)

fix: improve output a bit
no need to show a warning when skipping a pipe because it is disabled...

vercel[bot]: This pull request is being automatically deployed with Vercel ([learn more](https://vercel.link/github-learn-more)).  
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: [https://vercel.com/goreleaser/goreleaser/FFHdFTsLwge4wFfehZEMPaH8S1BM](https://vercel.com/goreleaser/goreleaser/FFHdFTsLwge4wFfehZEMPaH8S1BM)  
✅ Preview: *In Progress*


kodiakhq[bot]: 
This PR currently has a merge conflict. Please resolve this and then re-add the `automerge` label.

codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2174?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
> Merging [#2174](https://codecov.io/gh/goreleaser/goreleaser/pull/2174?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (5f6c24c) into [master](https://codecov.io/gh/goreleaser/goreleaser/commit/a9efdcab4a7189b455fe908cce6961a74c67a651?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (a9efdca) will **increase** coverage by `0.02%`.
> The diff coverage is `96.72%`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/graphs/tree.svg?width=650&height=150&src=pr&token=3bJvv6b7hN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)](https://codecov.io/gh/goreleaser/goreleaser/pull/2174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)

```diff
@@            Coverage Diff             @@
##           master    #2174      +/-   ##
==========================================
+ Coverage   82.65%   82.67%   +0.02%     
==========================================
  Files          75       75              
  Lines        4117     4122       +5     
==========================================
+ Hits         3403     3408       +5     
  Misses        580      580              
  Partials      134      134              
```


| [Impacted Files](https://codecov.io/gh/goreleaser/goreleaser/pull/2174?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) | Coverage Δ | |
|---|---|---|
| [internal/middleware/logging.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvbWlkZGxld2FyZS9sb2dnaW5nLmdv) | `100.00% <ø> (ø)` | |
| [internal/pipe/docker/docker.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9kb2NrZXIvZG9ja2VyLmdv) | `94.20% <88.88%> (-0.05%)` | :arrow_down: |
| [internal/pipe/brew/brew.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9icmV3L2JyZXcuZ28=) | `77.84% <91.66%> (-0.13%)` | :arrow_down: |
| [internal/middleware/error.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvbWlkZGxld2FyZS9lcnJvci5nbw==) | `100.00% <100.00%> (ø)` | |
| [internal/pipe/artifactory/artifactory.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9hcnRpZmFjdG9yeS9hcnRpZmFjdG9yeS5nbw==) | `100.00% <100.00%> (ø)` | |
| [internal/pipe/blob/blob.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9ibG9iL2Jsb2IuZ28=) | `100.00% <100.00%> (ø)` | |
| [internal/pipe/changelog/changelog.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9jaGFuZ2Vsb2cvY2hhbmdlbG9nLmdv) | `92.85% <100.00%> (ø)` | |
| [internal/pipe/checksums/checksums.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9jaGVja3N1bXMvY2hlY2tzdW1zLmdv) | `100.00% <100.00%> (ø)` | |
| [internal/pipe/custompublishers/custompublishers.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9jdXN0b21wdWJsaXNoZXJzL2N1c3RvbXB1Ymxpc2hlcnMuZ28=) | `75.00% <100.00%> (ø)` | |
| [internal/pipe/gomod/gomod.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvcGlwZS9nb21vZC9nb21vZC5nbw==) | `78.94% <100.00%> (ø)` | |
| ... and [7 more](https://codecov.io/gh/goreleaser/goreleaser/pull/2174/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2174?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2174?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Last update [a9efdca...5f6c24c](https://codecov.io/gh/goreleaser/goreleaser/pull/2174?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).


Patch:
diff --git a/internal/middleware/error.go b/internal/middleware/error.go
index 6cdf2cf3..f4d063cd 100644
--- a/internal/middleware/error.go
+++ b/internal/middleware/error.go
@@ -10,10 +10,14 @@ import (
 // errors.
 func ErrHandler(action Action) Action {
 	return func(ctx *context.Context) error {
-		var err = action(ctx)
+		err := action(ctx)
 		if err == nil {
 			return nil
 		}
+		if pipe.IsExpectedSkip(err) {
+			log.WithError(err).Debug("pipe skipped")
+			return nil
+		}
 		if pipe.IsSkip(err) {
 			log.WithError(err).Warn("pipe skipped")
 			return nil
diff --git a/internal/middleware/logging.go b/internal/middleware/logging.go
index d4a94501..8cf3d4e5 100644
--- a/internal/middleware/logging.go
+++ b/internal/middleware/logging.go
@@ -14,7 +14,7 @@ type Padding int
 const DefaultInitialPadding Padding = 3
 
 // ExtraPadding is the double of the DefaultInitialPadding.
-const ExtraPadding Padding = DefaultInitialPadding * 2
+const ExtraPadding = DefaultInitialPadding * 2
 
 // Logging pretty prints the given action and its title.
 // You can have different padding levels by providing different initial
diff --git a/internal/pipe/artifactory/artifactory.go b/internal/pipe/artifactory/artifactory.go
index bf337ff6..6fabecae 100644
--- a/internal/pipe/artifactory/artifactory.go
+++ b/internal/pipe/artifactory/artifactory.go
@@ -36,7 +36,7 @@ func (Pipe) Default(ctx *context.Context) error {
 // Docs: https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-Example-DeployinganArtifact
 func (Pipe) Publish(ctx *context.Context) error {
 	if len(ctx.Config.Artifactories) == 0 {
-		return pipe.Skip("artifactory section is not configured")
+		return pipe.ErrSkipDisabledPipe
 	}
 
 	// Check requirements for every instance we have configured.
diff --git a/internal/pipe/blob/blob.go b/internal/pipe/blob/blob.go
index 4276f651..ef46cdb5 100644
--- a/internal/pipe/blob/blob.go
+++ b/internal/pipe/blob/blob.go
@@ -36,10 +36,10 @@ func (Pipe) Default(ctx *context.Context) error {
 // Publish to specified blob bucket url.
 func (Pipe) Publish(ctx *context.Context) error {
 	if len(ctx.Config.Blobs) == 0 {
-		return pipe.Skip("blobs section is not configured")
+		return pipe.ErrSkipDisabledPipe
 	}
 
-	var g = semerrgroup.New(ctx.Parallelism)
+	g := semerrgroup.New(ctx.Parallelism)
 	for _, conf := range ctx.Config.Blobs {
 		conf := conf
 		g.Go(func() error {
diff --git a/internal/pipe/brew/brew.go b/internal/pipe/brew/brew.go
index c62e0f10..1cdad59c 100644
--- a/internal/pipe/brew/brew.go
+++ b/internal/pipe/brew/brew.go
@@ -63,9 +63,9 @@ func (Pipe) Publish(ctx *context.Context) error {
 func publishAll(ctx *context.Context, cli client.Client) error {
 	// even if one of them skips, we run them all, and then show return the skips all at once.
 	// this is needed so we actually create the `dist/foo.rb` file, which is useful for debugging.
-	var skips = pipe.SkipMemento{}
+	skips := pipe.SkipMemento{}
 	for _, brew := range ctx.Config.Brews {
-		var err = doRun(ctx, brew, cli)
+		err := doRun(ctx, brew, cli)
 		if err != nil && pipe.IsSkip(err) {
 			skips.Remember(err)
 			continue
@@ -80,7 +80,7 @@ func publishAll(ctx *context.Context, cli client.Client) error {
 // Default sets the pipe defaults.
 func (Pipe) Default(ctx *context.Context) error {
 	for i := range ctx.Config.Brews {
-		var brew = &ctx.Config.Brews[i]
+		brew := &ctx.Config.Brews[i]
 
 		if brew.Install == "" {
 			brew.Install = fmt.Sprintf(`bin.install "%s"`, ctx.Config.ProjectName)
@@ -105,7 +105,7 @@ func (Pipe) Default(ctx *context.Context) error {
 
 func doRun(ctx *context.Context, brew config.Homebrew, cl client.Client) error {
 	if brew.Tap.Name == "" {
-		return pipe.Skip("brew section is not configured")
+		return pipe.ErrSkipDisabledPipe
 	}
 
 	if brew.Tap.Token != "" {
@@ -122,7 +122,7 @@ func doRun(ctx *context.Context, brew config.Homebrew, cl client.Client) error {
 	}
 
 	// TODO: properly cover this with tests
-	var filters = []artifact.Filter{
+	filters := []artifact.Filter{
 		artifact.Or(
 			artifact.ByGoos("darwin"),
 			artifact.ByGoos("linux"),
@@ -142,7 +142,7 @@ func doRun(ctx *context.Context, brew config.Homebrew, cl client.Client) error {
 		filters = append(filters, artifact.ByIDs(brew.IDs...))
 	}
 
-	var archives = ctx.Artifacts.Filter(artifact.And(filters...)).List()
+	archives := ctx.Artifacts.Filter(artifact.And(filters...)).List()
 	if len(archives) == 0 {
 		return ErrNoArchivesFound
 	}
@@ -158,10 +158,10 @@ func doRun(ctx *context.Context, brew config.Homebrew, cl client.Client) error {
 		return err
 	}
 
-	var filename = brew.Name + ".rb"
-	var path = filepath.Join(ctx.Config.Dist, filename)
+	filename := brew.Name + ".rb"
+	path := filepath.Join(ctx.Config.Dist, filename)
 	log.WithField("formula", path).Info("writing")
-	if err := ioutil.WriteFile(path, []byte(content), 0644); err != nil { //nolint: gosec
+	if err := ioutil.WriteFile(path, []byte(content), 0o644); err != nil { //nolint: gosec
 		return fmt.Errorf("failed to write brew formula: %w", err)
 	}
 
@@ -177,12 +177,12 @@ func doRun(ctx *context.Context, brew config.Homebrew, cl client.Client) error {
 
 	repo := client.RepoFromRef(brew.Tap)
 
-	var gpath = buildFormulaPath(brew.Folder, filename)
+	gpath := buildFormulaPath(brew.Folder, filename)
 	log.WithField("formula", gpath).
 		WithField("repo", repo.String()).
 		Info("pushing")
 
-	var msg = fmt.Sprintf("Brew formula update for %s version %s", ctx.Config.ProjectName, ctx.Git.CurrentTag)
+	msg := fmt.Sprintf("Brew formula update for %s version %s", ctx.Config.ProjectName, ctx.Git.CurrentTag)
 	return cl.CreateFile(ctx, brew.CommitAuthor, repo, []byte(content), gpath, msg)
 }
 
@@ -232,7 +232,7 @@ func doBuildFormula(ctx *context.Context, data templateData) (string, error) {
 }
 
 func dataFor(ctx *context.Context, cfg config.Homebrew, cl client.Client, artifacts []*artifact.Artifact) (templateData, error) {
-	var result = templateData{
+	result := templateData{
 		Name:             formulaNameFor(cfg.Name),
 		Desc:             cfg.Description,
 		Homepage:         cfg.Homepage,
@@ -270,7 +270,7 @@ func dataFor(ctx *context.Context, cfg config.Homebrew, cl client.Client, artifa
 		if err != nil {
 			return result, err
 		}
-		var down = downloadable{
+		down := downloadable{
 			DownloadURL: url,
 			SHA256:      sum,
 		}
diff --git a/internal/pipe/changelog/changelog.go b/internal/pipe/changelog/changelog.go
index f9d72d8d..25779ce0 100644
--- a/internal/pipe/changelog/changelog.go
+++ b/internal/pipe/changelog/changelog.go
@@ -46,7 +46,7 @@ func (Pipe) Run(ctx *context.Context) error {
 		ctx.ReleaseNotes = notes
 	}
 	if ctx.Config.Changelog.Skip {
-		return pipe.Skip("changelog should not be built")
+		return pipe.ErrSkipDisabledPipe
 	}
 	if ctx.Snapshot {
 		return pipe.Skip("not available for snapshots")
@@ -110,9 +110,9 @@ func (Pipe) Run(ctx *context.Context) error {
 		ctx.ReleaseNotes += "\n"
 	}
 
-	var path = filepath.Join(ctx.Config.Dist, "CHANGELOG.md")
+	path := filepath.Join(ctx.Config.Dist, "CHANGELOG.md")
 	log.WithField("changelog", path).Info("writing")
-	return ioutil.WriteFile(path, []byte(ctx.ReleaseNotes), 0644) //nolint: gosec
+	return ioutil.WriteFile(path, []byte(ctx.ReleaseNotes), 0o644) //nolint: gosec
 }
 
 func loadFromFile(file string) (string, error) {
@@ -140,7 +140,7 @@ func buildChangelog(ctx *context.Context) ([]string, error) {
 	if err != nil {
 		return nil, err
 	}
-	var entries = strings.Split(log, "\n")
+	entries := strings.Split(log, "\n")
 	entries = entries[0 : len(entries)-1]
 	entries, err = filterEntries(ctx, entries)
 	if err != nil {
@@ -161,15 +161,15 @@ func filterEntries(ctx *context.Context, entries []string) ([]string, error) {
 }
 
 func sortEntries(ctx *context.Context, entries []string) []string {
-	var direction = ctx.Config.Changelog.Sort
+	direction := ctx.Config.Changelog.Sort
 	if direction == "" {
 		return entries
 	}
-	var result = make([]string, len(entries))
+	result := make([]string, len(entries))
 	copy(result, entries)
 	sort.Slice(result, func(i, j int) bool {
-		var imsg = extractCommitInfo(result[i])
-		var jmsg = extractCommitInfo(result[j])
+		imsg := extractCommitInfo(result[i])
+		jmsg := extractCommitInfo(result[j])
 		if direction == "asc" {
 			return strings.Compare(imsg, jmsg) < 0
 		}
@@ -203,7 +203,7 @@ func getChangelog(tag string) (string, error) {
 }
 
 func gitLog(refs ...string) (string, error) {
-	var args = []string{"log", "--pretty=oneline", "--abbrev-commit", "--no-decorate", "--no-color"}
+	args := []string{"log", "--pretty=oneline", "--abbrev-commit", "--no-decorate", "--no-color"}
 	args = append(args, refs...)
 	return git.Run(args...)
 }
diff --git a/internal/pipe/checksums/checksums.go b/internal/pipe/checksums/checksums.go
index a28eb47a..03d1281c 100644
--- a/internal/pipe/checksums/checksums.go
+++ b/internal/pipe/checksums/checksums.go
@@ -38,7 +38,7 @@ func (Pipe) Default(ctx *context.Context) error {
 // Run the pipe.
 func (Pipe) Run(ctx *context.Context) (err error) {
 	if ctx.Config.Checksum.Disable {
-		return pipe.Skip("checksum.disable is set")
+		return pipe.ErrSkipDisabledPipe
 	}
 	filter := artifact.Or(
 		artifact.ByType(artifact.UploadableArchive),
@@ -55,7 +55,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
 		return nil
 	}
 
-	var g = semerrgroup.New(ctx.Parallelism)
+	g := semerrgroup.New(ctx.Parallelism)
 	sumLines := make([]string, len(artifactList))
 	for i, artifact := range artifactList {
 		i := i
@@ -82,7 +82,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
 	file, err := os.OpenFile(
 		filepath.Join(ctx.Config.Dist, filename),
 		os.O_APPEND|os.O_WRONLY|os.O_CREATE|os.O_TRUNC,
-		0644,
+		0o644,
 	)
 	if err != nil {
 		return err
diff --git a/internal/pipe/custompublishers/custompublishers.go b/internal/pipe/custompublishers/custompublishers.go
index b0b88dd2..f962f274 100644
--- a/internal/pipe/custompublishers/custompublishers.go
+++ b/internal/pipe/custompublishers/custompublishers.go
@@ -18,7 +18,7 @@ func (Pipe) String() string {
 // Publish artifacts.
 func (Pipe) Publish(ctx *context.Context) error {
 	if len(ctx.Config.Publishers) == 0 {
-		return pipe.Skip("publishers section is not configured")
+		return pipe.ErrSkipDisabledPipe
 	}
 
 	return exec.Execute(ctx, ctx.Config.Publishers)
diff --git a/internal/pipe/docker/docker.go b/internal/pipe/docker/docker.go
index 15dcd98e..df2cf3a1 100644
--- a/internal/pipe/docker/docker.go
+++ b/internal/pipe/docker/docker.go
@@ -32,7 +32,7 @@ func (Pipe) String() string {
 // Default sets the pipe defaults.
 func (Pipe) Default(ctx *context.Context) error {
 	for i := range ctx.Config.Dockers {
-		var docker = &ctx.Config.Dockers[i]
+		docker := &ctx.Config.Dockers[i]
 
 		if docker.Goos == "" {
 			docker.Goos = "linux"
@@ -62,7 +62,7 @@ func (Pipe) Default(ctx *context.Context) error {
 // Run the pipe.
 func (Pipe) Run(ctx *context.Context) error {
 	if len(ctx.Config.Dockers) == 0 || len(ctx.Config.Dockers[0].ImageTemplates) == 0 {
-		return pipe.Skip("docker section is not configured")
+		return pipe.ErrSkipDisabledPipe
 	}
 	_, err := exec.LookPath("docker")
 	if err != nil {
@@ -76,7 +76,7 @@ func (Pipe) Publish(ctx *context.Context) error {
 	if ctx.SkipPublish {
 		return pipe.ErrSkipPublishEnabled
 	}
-	var images = ctx.Artifacts.Filter(artifact.ByType(artifact.PublishableDockerImage)).List()
+	images := ctx.Artifacts.Filter(artifact.ByType(artifact.PublishableDockerImage)).List()
 	for _, image := range images {
 		if err := dockerPush(ctx, image); err != nil {
 			return err
@@ -86,12 +86,12 @@ func (Pipe) Publish(ctx *context.Context) error {
 }
 
 func doRun(ctx *context.Context) error {
-	var g = semerrgroup.NewSkipAware(semerrgroup.New(ctx.Parallelism))
+	g := semerrgroup.NewSkipAware(semerrgroup.New(ctx.Parallelism))
 	for _, docker := range ctx.Config.Dockers {
 		docker := docker
 		g.Go(func() error {
 			log.WithField("docker", docker).Debug("looking for artifacts matching")
-			var filters = []artifact.Filter{
+			filters := []artifact.Filter{
 				artifact.ByGoos(docker.Goos),
 				artifact.ByGoarch(docker.Goarch),
 				artifact.ByGoarm(docker.Goarm),
@@ -103,7 +103,7 @@ func doRun(ctx *context.Context) error {
 			if len(docker.IDs) > 0 {
 				filters = append(filters, artifact.ByIDs(docker.IDs...))
 			}
-			var artifacts = ctx.Artifacts.Filter(artifact.And(filters...))
+			artifacts := ctx.Artifacts.Filter(artifact.And(filters...))
 			log.WithField("artifacts", artifacts.Paths()).Debug("found artifacts")
 			return process(ctx, docker, artifacts.List())
 		})
@@ -127,7 +127,7 @@ func process(ctx *context.Context, docker config.Docker, artifacts []*artifact.A
 		return fmt.Errorf("failed to link dockerfile: %w", err)
 	}
 	for _, file := range docker.Files {
-		if err := os.MkdirAll(filepath.Join(tmp, filepath.Dir(file)), 0755); err != nil {
+		if err := os.MkdirAll(filepath.Join(tmp, filepath.Dir(file)), 0o755); err != nil {
 			return fmt.Errorf("failed to link extra file '%s': %w", file, err)
 		}
 		if err := link(file, filepath.Join(tmp, file)); err != nil {
@@ -217,7 +217,7 @@ func link(src, dest string) error {
 		// - dest = "dist/linuxamd64/b"
 		// - path = "a/b/c.txt"
 		// So we join "a/b" with "c.txt" and use it as the destination.
-		var dst = filepath.Join(dest, strings.Replace(path, src, "", 1))
+		dst := filepath.Join(dest, strings.Replace(path, src, "", 1))
 		log.WithFields(log.Fields{
 			"src": path,
 			"dst": dst,
@@ -232,7 +232,7 @@ func link(src, dest string) error {
 func dockerBuild(ctx *context.Context, root string, images, flags []string, buildx bool) error {
 	log.WithField("image", images[0]).WithField("buildx", buildx).Info("building docker image")
 	/* #nosec */
-	var cmd = exec.CommandContext(ctx, "docker", buildCommand(buildx, images, flags)...)
+	cmd := exec.CommandContext(ctx, "docker", buildCommand(buildx, images, flags)...)
 	cmd.Dir = root
 	log.WithField("cmd", cmd.Args).WithField("cwd", cmd.Dir).Debug("running")
 	out, err := cmd.CombinedOutput()
@@ -258,7 +258,7 @@ func buildCommand(buildx bool, images, flags []string) []string {
 func dockerPush(ctx *context.Context, image *artifact.Artifact) error {
 	log.WithField("image", image.Name).Info("pushing docker image")
 	/* #nosec */
-	var cmd = exec.CommandContext(ctx, "docker", "push", image.Name)
+	cmd := exec.CommandContext(ctx, "docker", "push", image.Name)
 	log.WithField("cmd", cmd.Args).Debug("running")
 	out, err := cmd.CombinedOutput()
 	if err != nil {
diff --git a/internal/pipe/gomod/gomod.go b/internal/pipe/gomod/gomod.go
index 5562afa3..36997622 100644
--- a/internal/pipe/gomod/gomod.go
+++ b/internal/pipe/gomod/gomod.go
@@ -53,7 +53,7 @@ func (Pipe) Run(ctx *context.Context) error {
 	ctx.ModulePath = result
 
 	if !ctx.Config.GoMod.Proxy {
-		return pipe.Skip("gomod.proxy is disabled")
+		return pipe.ErrSkipDisabledPipe
 	}
 
 	if ctx.Snapshot {
diff --git a/internal/pipe/milestone/milestone.go b/internal/pipe/milestone/milestone.go
index 2b3fcb8a..6acf17bb 100644
--- a/internal/pipe/milestone/milestone.go
+++ b/internal/pipe/milestone/milestone.go
@@ -63,11 +63,10 @@ func doPublish(ctx *context.Context, vcsClient client.Client) error {
 		milestone := &ctx.Config.Milestones[i]
 
 		if !milestone.Close {
-			return pipe.Skip("milestone pipe is disabled")
+			return pipe.ErrSkipDisabledPipe
 		}
 
 		name, err := tmpl.New(ctx).Apply(milestone.NameTemplate)
-
 		if err != nil {
 			return err
 		}
diff --git a/internal/pipe/pipe.go b/internal/pipe/pipe.go
index f5e68243..d33636a8 100644
--- a/internal/pipe/pipe.go
+++ b/internal/pipe/pipe.go
@@ -22,14 +22,31 @@ var ErrSkipSignEnabled = Skip("artifact signing is disabled")
 // It means that the part of a Piper that validates some things was not run.
 var ErrSkipValidateEnabled = Skip("validation is disabled")
 
+// ErrSkipDisabledPipe happens when a pipe is skipped because it is not configured.
+var ErrSkipDisabledPipe = ErrSkip{
+	reason: "pipe not configured/disabled",
+	expected: true,
+}
+
 // IsSkip returns true if the error is an ErrSkip.
 func IsSkip(err error) bool {
 	return errors.As(err, &ErrSkip{})
 }
 
+// IsExpectedSkip returns true if the given error is ErrSkip and if it is an
+// expected skip.
+func IsExpectedSkip(err error) bool {
+	skipErr := ErrSkip{}
+	if !errors.As(err, &skipErr) {
+		return false
+	}
+	return skipErr.expected
+}
+
 // ErrSkip occurs when a pipe is skipped for some reason.
 type ErrSkip struct {
-	reason string
+	reason   string
+	expected bool
 }
 
 // Error implements the error interface. returns the reason the pipe was skipped.
diff --git a/internal/pipe/release/release.go b/internal/pipe/release/release.go
index 75a1d7f0..63eab65b 100644
--- a/internal/pipe/release/release.go
+++ b/internal/pipe/release/release.go
@@ -113,7 +113,7 @@ func (Pipe) Publish(ctx *context.Context) error {
 
 func doPublish(ctx *context.Context, client client.Client) error {
 	if ctx.Config.Release.Disable {
-		return pipe.Skip("release pipe is disabled")
+		return pipe.ErrSkipDisabledPipe
 	}
 	log.WithField("tag", ctx.Git.CurrentTag).
 		WithField("repo", ctx.Config.Release.GitHub.String()).
@@ -143,7 +143,7 @@ func doPublish(ctx *context.Context, client client.Client) error {
 		})
 	}
 
-	var filters = artifact.Or(
+	filters := artifact.Or(
 		artifact.ByType(artifact.UploadableArchive),
 		artifact.ByType(artifact.UploadableBinary),
 		artifact.ByType(artifact.UploadableSourceArchive),
@@ -158,7 +158,7 @@ func doPublish(ctx *context.Context, client client.Client) error {
 
 	filters = artifact.Or(filters, artifact.ByType(artifact.UploadableFile))
 
-	var g = semerrgroup.New(ctx.Parallelism)
+	g := semerrgroup.New(ctx.Parallelism)
 	for _, artifact := range ctx.Artifacts.Filter(filters).List() {
 		artifact := artifact
 		g.Go(func() error {
diff --git a/internal/pipe/scoop/scoop.go b/internal/pipe/scoop/scoop.go
index 611280cd..689bf383 100644
--- a/internal/pipe/scoop/scoop.go
+++ b/internal/pipe/scoop/scoop.go
@@ -64,7 +64,7 @@ func (Pipe) Default(ctx *context.Context) error {
 func doRun(ctx *context.Context, cl client.Client) error {
 	scoop := ctx.Config.Scoop
 	if scoop.Bucket.Name == "" {
-		return pipe.Skip("scoop section is not configured")
+		return pipe.ErrSkipDisabledPipe
 	}
 
 	if scoop.Bucket.Token != "" {
@@ -85,7 +85,7 @@ func doRun(ctx *context.Context, cl client.Client) error {
 		return pipe.Skip("archive format is binary")
 	}
 
-	var archives = ctx.Artifacts.Filter(
+	archives := ctx.Artifacts.Filter(
 		artifact.And(
 			artifact.ByGoos("windows"),
 			artifact.ByType(artifact.UploadableArchive),
@@ -95,7 +95,7 @@ func doRun(ctx *context.Context, cl client.Client) error {
 		return ErrNoWindows
 	}
 
-	var path = scoop.Name + ".json"
+	path := scoop.Name + ".json"
 
 	data, err := dataFor(ctx, cl, archives)
 	if err != nil {
@@ -170,7 +170,7 @@ func doBuildManifest(manifest Manifest) (bytes.Buffer, error) {
 }
 
 func dataFor(ctx *context.Context, cl client.Client, artifacts []*artifact.Artifact) (Manifest, error) {
-	var manifest = Manifest{
+	manifest := Manifest{
 		Version:      ctx.Version,
 		Architecture: map[string]Resource{},
 		Homepage:     ctx.Config.Scoop.Homepage,
@@ -239,7 +239,7 @@ func dataFor(ctx *context.Context, cl client.Client, artifacts []*artifact.Artif
 func binaries(a *artifact.Artifact) []string {
 	// nolint: prealloc
 	var bins []string
-	var wrap = a.ExtraOr("WrappedIn", "").(string)
+	wrap := a.ExtraOr("WrappedIn", "").(string)
 	for _, b := range a.ExtraOr("Builds", []*artifact.Artifact{}).([]*artifact.Artifact) {
 		bins = append(bins, filepath.Join(wrap, b.Name))
 	}
diff --git a/internal/pipe/snapshot/snapshot.go b/internal/pipe/snapshot/snapshot.go
index 7f5abc3d..5e9f7929 100644
--- a/internal/pipe/snapshot/snapshot.go
+++ b/internal/pipe/snapshot/snapshot.go
@@ -26,7 +26,7 @@ func (Pipe) Default(ctx *context.Context) error {
 
 func (Pipe) Run(ctx *context.Context) error {
 	if !ctx.Snapshot {
-		return pipe.Skip("not a snapshot")
+		return pipe.ErrSkipDisabledPipe
 	}
 	name, err := tmpl.New(ctx).Apply(ctx.Config.Snapshot.NameTemplate)
 	if err != nil {
diff --git a/internal/pipe/sourcearchive/source.go b/internal/pipe/sourcearchive/source.go
index 2e3d7a53..99fca210 100644
--- a/internal/pipe/sourcearchive/source.go
+++ b/internal/pipe/sourcearchive/source.go
@@ -22,15 +22,15 @@ func (Pipe) String() string {
 // Run the pipe.
 func (Pipe) Run(ctx *context.Context) (err error) {
 	if !ctx.Config.Source.Enabled {
-		return pipe.Skip("source pipe is disabled")
+		return pipe.ErrSkipDisabledPipe
 	}
 
 	name, err := tmpl.New(ctx).Apply(ctx.Config.Source.NameTemplate)
 	if err != nil {
 		return err
 	}
-	var filename = name + "." + ctx.Config.Source.Format
-	var path = filepath.Join(ctx.Config.Dist, filename)
+	filename := name + "." + ctx.Config.Source.Format
+	path := filepath.Join(ctx.Config.Dist, filename)
 	log.WithField("file", filename).Info("creating source archive")
 	out, err := git.Clean(git.Run("archive", "-o", path, ctx.Git.FullCommit))
 	log.Debug(out)
@@ -47,7 +47,7 @@ func (Pipe) Run(ctx *context.Context) (err error) {
 
 // Default sets the pipe defaults.
 func (Pipe) Default(ctx *context.Context) error {
-	var archive = &ctx.Config.Source
+	archive := &ctx.Config.Source
 	if archive.Format == "" {
 		archive.Format = "tar.gz"
 	}
diff --git a/internal/pipe/upload/upload.go b/internal/pipe/upload/upload.go
index 476625f1..fe457224 100644
--- a/internal/pipe/upload/upload.go
+++ b/internal/pipe/upload/upload.go
@@ -26,7 +26,7 @@ func (Pipe) Default(ctx *context.Context) error {
 // Publish artifacts.
 func (Pipe) Publish(ctx *context.Context) error {
 	if len(ctx.Config.Uploads) == 0 {
-		return pipe.Skip("uploads section is not configured")
+		return pipe.ErrSkipDisabledPipe
 	}
 
 	// Check requirements for every instance we have configured.
diff --git a/www/docs/customization/gomod.md b/www/docs/customization/gomod.md
index e2dcb58a..dd770126 100644
--- a/www/docs/customization/gomod.md
+++ b/www/docs/customization/gomod.md
@@ -15,7 +15,7 @@ Configuration options available are described bellow.
 gomod:
   # Proxy a module from proxy.golang.org, making the builds verifiable.
   # This will only be effective if running against a tag. Snapshots will ignore this setting.
-  # PS: for this to work you `build.main` must be a package, not a `.go` file.
+  # Notice: for this to work you `build.main` must be a package, not a `.go` file.
   #
   # Default is false.
   proxy: true


Test patch:
diff --git a/internal/middleware/error_test.go b/internal/middleware/error_test.go
index a92582d9..dbbc7d4c 100644
--- a/internal/middleware/error_test.go
+++ b/internal/middleware/error_test.go
@@ -17,6 +17,10 @@ func TestError(t *testing.T) {
 		require.NoError(t, ErrHandler(mockAction(pipe.ErrSkipValidateEnabled))(ctx))
 	})
 
+	t.Run("pipe expected skipped", func(t *testing.T) {
+		require.NoError(t, ErrHandler(mockAction(pipe.ErrSkipDisabledPipe))(ctx))
+	})
+
 	t.Run("some err", func(t *testing.T) {
 		require.Error(t, ErrHandler(mockAction(fmt.Errorf("pipe errored")))(ctx))
 	})
diff --git a/internal/pipe/checksums/checksums_test.go b/internal/pipe/checksums/checksums_test.go
index fb0057ba..82dd184a 100644
--- a/internal/pipe/checksums/checksums_test.go
+++ b/internal/pipe/checksums/checksums_test.go
@@ -6,6 +6,7 @@ import (
 	"testing"
 
 	"github.com/goreleaser/goreleaser/internal/artifact"
+	"github.com/goreleaser/goreleaser/internal/pipe"
 	"github.com/goreleaser/goreleaser/internal/testlib"
 	"github.com/goreleaser/goreleaser/pkg/config"
 	"github.com/goreleaser/goreleaser/pkg/context"
@@ -114,7 +115,7 @@ func TestPipeSkipTrue(t *testing.T) {
 	)
 	var err = Pipe{}.Run(ctx)
 	testlib.AssertSkipped(t, err)
-	require.EqualError(t, err, `checksum.disable is set`)
+	require.EqualError(t, err, pipe.ErrSkipDisabledPipe.Error())
 }
 
 func TestPipeFileNotExist(t *testing.T) {
diff --git a/internal/pipe/pipe_test.go b/internal/pipe/pipe_test.go
index 32d2bdbe..c70cc214 100644
--- a/internal/pipe/pipe_test.go
+++ b/internal/pipe/pipe_test.go
@@ -8,19 +8,25 @@ import (
 )
 
 func TestSkipPipe(t *testing.T) {
-	var reason = "this is a test"
-	var err = Skip(reason)
+	reason := "this is a test"
+	err := Skip(reason)
 	require.Error(t, err)
 	require.Equal(t, reason, err.Error())
 }
 
 func TestIsSkip(t *testing.T) {
 	require.True(t, IsSkip(Skip("whatever")))
+	require.True(t, IsSkip(ErrSkipDisabledPipe))
 	require.False(t, IsSkip(errors.New("nope")))
 }
 
+func TestIsExpectedSkip(t *testing.T) {
+	require.True(t, IsSkip(ErrSkipDisabledPipe))
+	require.True(t, IsSkip(Skip("nope")))
+}
+
 func TestSkipMemento(t *testing.T) {
-	var m = SkipMemento{}
+	m := SkipMemento{}
 	m.Remember(Skip("foo"))
 	m.Remember(Skip("bar"))
 	// test duplicated errors
diff --git a/internal/pipe/scoop/scoop_test.go b/internal/pipe/scoop/scoop_test.go
index 4d2b858f..f2d241a9 100644
--- a/internal/pipe/scoop/scoop_test.go
+++ b/internal/pipe/scoop/scoop_test.go
@@ -469,7 +469,7 @@ func Test_doRun(t *testing.T) {
 				{Name: "foo_1.0.1_windows_amd64.tar.gz", Goos: "windows", Goarch: "amd64"},
 				{Name: "foo_1.0.1_windows_386.tar.gz", Goos: "windows", Goarch: "386"},
 			},
-			shouldErr("scoop section is not configured"),
+			shouldErr(pipe.ErrSkipDisabledPipe.Error()),
 		},
 		{
 			"no publish",