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:
parent
a9f33bd659
commit
13d2bca06f
@ -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 {
|
||||
|
@ -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 = "."
|
||||
|
Loading…
x
Reference in New Issue
Block a user