Skip to content
Permalink
Browse files

chore: fix lint issues

refs #688
  • Loading branch information...
caarlos0 committed Jun 19, 2018
1 parent 411a73d commit 4fa90808852b5ed8fe79f1fa0d48e22ffca63b6a
Showing with 17 additions and 7 deletions.
  1. +9 −2 internal/builders/golang/targets.go
  2. +1 −1 internal/client/github.go
  3. +6 −3 pipeline/git/git.go
  4. +1 −1 pipeline/pipeline.go
@@ -44,11 +44,18 @@ func allBuildTargets(build config.Build) (targets []target) {
for _, goarch := range build.Goarch {
if goarch == "arm" {
for _, goarm := range build.Goarm {
targets = append(targets, target{goos, goarch, goarm})
targets = append(targets, target{
os: goos,
arch: goarch,
arm: goarm,
})
}
continue
}
targets = append(targets, target{goos, goarch, ""})
targets = append(targets, target{
os: goos,
arch: goarch,
})
}
}
return
@@ -36,7 +36,7 @@ func NewGitHub(ctx *context.Context) (Client, error) {
client.UploadURL = upload
}

return &githubClient{client}, nil
return &githubClient{client: client}, nil
}

func (c *githubClient) CreateFile(
@@ -122,14 +122,17 @@ func validate(ctx *context.Context) error {
}
out, err := git.Run("status", "--porcelain")
if strings.TrimSpace(out) != "" || err != nil {
return ErrDirty{out}
return ErrDirty{status: out}
}
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))
if err != nil {
return ErrWrongRef{ctx.Git.Commit, ctx.Git.CurrentTag}
return ErrWrongRef{
commit: ctx.Git.Commit,
tag: ctx.Git.CurrentTag,
}
}
return nil
}
@@ -35,5 +35,5 @@ func (e ErrSkip) Error() string {

// Skip skips this pipe with the given reason
func Skip(reason string) ErrSkip {
return ErrSkip{reason}
return ErrSkip{reason: reason}
}

0 comments on commit 4fa9080

Please sign in to comment.
You can’t perform that action at this time.