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

refactor: improved error message

The error message was kind of bad. Improved it
This commit is contained in:
Carlos Alexandro Becker 2017-11-19 16:08:57 -02:00 committed by Carlos Alexandro Becker
parent a9f33bd659
commit 13d2bca06f
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ func checkMain(ctx *context.Context, build config.Build) error {
}
packs, err := parser.ParseDir(token.NewFileSet(), dir, nil, 0)
if err != nil {
return errors.Wrapf(err, "failed dir: %s", dir)
return errors.Wrapf(err, "failed to parse dir: %s", dir)
}
for _, pack := range packs {
for _, file := range pack.Files {

View File

@ -277,7 +277,7 @@ func TestRunPipeWithouMainFunc(t *testing.T) {
})
t.Run("not main.go", func(t *testing.T) {
ctx.Config.Builds[0].Main = "foo.go"
assert.EqualError(t, Pipe{}.Run(ctx), `failed dir: foo.go: open foo.go: no such file or directory`)
assert.EqualError(t, Pipe{}.Run(ctx), `failed to parse dir: foo.go: open foo.go: no such file or directory`)
})
t.Run("glob", func(t *testing.T) {
ctx.Config.Builds[0].Main = "."