Skip to content

Commit

Permalink
Use absolute path when running imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Moran committed Jul 3, 2019
1 parent c1bd10a commit a573ac8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ Flags:
stderr.Fatalf("could not format fake ast: %s", err)
}

result, err := imports.Process(output.Name(), buffer.Bytes(), nil)
outputPath, err := filepath.Abs(output.Name())
if err != nil {
stderr.Fatalf("could not determine output absolute path: %s", err)
}

result, err := imports.Process(outputPath, buffer.Bytes(), nil)
if err != nil {
stderr.Fatalf("could not process imports: %s\n\n%s", err, buffer.String())
}
Expand Down

0 comments on commit a573ac8

Please sign in to comment.