Skip to content

Commit

Permalink
fix: not using go mods on go 1.15
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Apr 3, 2021
1 parent f6b1d15 commit 50117da
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/pipe/gomod/gomod.go
Expand Up @@ -42,14 +42,13 @@ func (Pipe) Default(ctx *context.Context) error {
// Run the pipe.
func (Pipe) Run(ctx *context.Context) error {
out, err := exec.CommandContext(ctx, ctx.Config.GoMod.GoBinary, "list", "-m").CombinedOutput()
if err != nil {
return fmt.Errorf("failed to get module path: %w: %s", err, string(out))
}

result := strings.TrimSpace(string(out))
if result == go115NotAGoModuleError || result == go116NotAGoModuleError {
return pipe.Skip("not a go module")
}
if err != nil {
return fmt.Errorf("failed to get module path: %w: %s", err, string(out))
}

ctx.ModulePath = result

Expand Down

1 comment on commit 50117da

@vercel
Copy link

@vercel vercel bot commented on 50117da Apr 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.