1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

fix: lint issues

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker 2024-04-22 23:44:28 -03:00
parent 60f12deae0
commit 7552d0b4e0
No known key found for this signature in database
7 changed files with 6 additions and 11 deletions

View File

@ -672,7 +672,7 @@ func TestGetChangeloger(t *testing.T) {
ctx.TokenType = context.TokenTypeGitea
c, err := getChangeloger(ctx)
require.NoError(t, err)
require.IsType(t, c, &scmChangeloger{})
require.IsType(t, &scmChangeloger{}, c)
})
t.Run("invalid", func(t *testing.T) {

View File

@ -160,7 +160,7 @@ func proxyBuild(ctx *context.Context, build *config.Build) error {
log.Debugf("tidying")
cmd := exec.CommandContext(ctx, ctx.Config.GoMod.GoBinary, "get", ctx.ModulePath+"@"+ctx.Git.CurrentTag)
cmd.Dir = dir
cmd.Env = append(ctx.Config.GoMod.Env, os.Environ()...)
cmd.Env = append(ctx.Config.GoMod.Env, os.Environ()...) //nolint: gocritic
if out, err := cmd.CombinedOutput(); err != nil {
return newDetailedErrProxy(err, string(out))
}

View File

@ -458,7 +458,7 @@ func create(ctx *context.Context, fpm config.NFPM, format string, artifacts []*a
}
if !strings.HasSuffix(packageFilename, ext) {
packageFilename = packageFilename + ext
packageFilename += ext
}
path := filepath.Join(ctx.Config.Dist, packageFilename)

View File

@ -560,7 +560,7 @@ func testSBOMCataloging(
}),
)
wantFiles := append(artifacts, sbomPaths...)
wantFiles := append(artifacts, sbomPaths...) //nolint: gocritic
sort.Strings(wantFiles)
require.ElementsMatch(tb, wantFiles, gotFiles, "SBOM paths differ")

View File

@ -705,7 +705,7 @@ func testSign(
}),
)
wantFiles := append(artifacts, signaturePaths...)
wantFiles := append(artifacts, signaturePaths...) //nolint: gocritic
sort.Strings(wantFiles)
require.ElementsMatch(tb, wantFiles, gotFiles)

View File

@ -173,10 +173,6 @@ func TestFindBinaries(t *testing.T) {
goarm := ""
gomips := ""
goamd64 := ""
switch goos {
case "windows":
ext = ".exe"
}
if goos == "windows" {
ext = ".exe"
}

View File

@ -4,7 +4,6 @@ import (
"bytes"
"fmt"
"os"
"path/filepath"
"strings"
"testing"
@ -50,7 +49,7 @@ func TestFile(t *testing.T) {
f, err := os.CreateTemp(t.TempDir(), "config")
require.NoError(t, err)
require.NoError(t, f.Close())
_, err = Load(filepath.Join(f.Name()))
_, err = Load(f.Name())
require.NoError(t, err)
}