Skip to content

Commit

Permalink
fix : for go tool cover to work the file names should be absolute.
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Aug 22, 2022
1 parent ce1ea53 commit bfde681
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion goawk.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ argsLoop:
if covermode != "" {
// Inserting fake token that captures the file name we'll need it for coverage report.
buf.WriteByte(lexer.FILENAME_QUOTE)
buf.WriteString(progFile)
absPath, err := filepath.Abs(progFile)
if err != nil {
errorExit(err)
}
buf.WriteString(absPath)
buf.WriteByte(lexer.FILENAME_QUOTE)
}
_, err = buf.ReadFrom(f)
Expand Down

0 comments on commit bfde681

Please sign in to comment.