1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-22 04:08:49 +02:00

chore: fix lint issues

refs #688
This commit is contained in:
Carlos Alexandro Becker 2018-06-19 15:53:14 -03:00
parent 411a73d410
commit 4fa9080885
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
4 changed files with 17 additions and 7 deletions

View File

@ -44,11 +44,18 @@ func allBuildTargets(build config.Build) (targets []target) {
for _, goarch := range build.Goarch { for _, goarch := range build.Goarch {
if goarch == "arm" { if goarch == "arm" {
for _, goarm := range build.Goarm { for _, goarm := range build.Goarm {
targets = append(targets, target{goos, goarch, goarm}) targets = append(targets, target{
os: goos,
arch: goarch,
arm: goarm,
})
} }
continue continue
} }
targets = append(targets, target{goos, goarch, ""}) targets = append(targets, target{
os: goos,
arch: goarch,
})
} }
} }
return return

View File

@ -36,7 +36,7 @@ func NewGitHub(ctx *context.Context) (Client, error) {
client.UploadURL = upload client.UploadURL = upload
} }
return &githubClient{client}, nil return &githubClient{client: client}, nil
} }
func (c *githubClient) CreateFile( func (c *githubClient) CreateFile(

View File

@ -122,14 +122,17 @@ func validate(ctx *context.Context) error {
} }
out, err := git.Run("status", "--porcelain") out, err := git.Run("status", "--porcelain")
if strings.TrimSpace(out) != "" || err != nil { if strings.TrimSpace(out) != "" || err != nil {
return ErrDirty{out} return ErrDirty{status: out}
} }
if !regexp.MustCompile("^[0-9.]+").MatchString(ctx.Version) { if !regexp.MustCompile("^[0-9.]+").MatchString(ctx.Version) {
return ErrInvalidVersionFormat{ctx.Version} return ErrInvalidVersionFormat{version: ctx.Version}
} }
_, err = git.Clean(git.Run("describe", "--exact-match", "--tags", "--match", ctx.Git.CurrentTag)) _, err = git.Clean(git.Run("describe", "--exact-match", "--tags", "--match", ctx.Git.CurrentTag))
if err != nil { if err != nil {
return ErrWrongRef{ctx.Git.Commit, ctx.Git.CurrentTag} return ErrWrongRef{
commit: ctx.Git.Commit,
tag: ctx.Git.CurrentTag,
}
} }
return nil return nil
} }

View File

@ -35,5 +35,5 @@ func (e ErrSkip) Error() string {
// Skip skips this pipe with the given reason // Skip skips this pipe with the given reason
func Skip(reason string) ErrSkip { func Skip(reason string) ErrSkip {
return ErrSkip{reason} return ErrSkip{reason: reason}
} }