Skip to content

Commit d1bfe0a

Browse files
committed
set default for coverage file flag
1 parent 56590d7 commit d1bfe0a

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

cmd/main.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ import (
1515

1616
func main() {
1717
cliFlags := flags.ParseFlags()
18-
if cliFlags.CoverageFile == "" {
19-
fmt.Printf("Missing argument -%s\n", flags.FlagCoverFile)
20-
os.Exit(1)
21-
}
2218

2319
covFile, err := os.Open(cliFlags.CoverageFile)
2420
if err != nil {

pkg/flags/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Flags struct {
1717
}
1818

1919
func ParseFlags() Flags {
20-
coverFile := flag.String(FlagCoverFile, "",
20+
coverFile := flag.String(FlagCoverFile, "coverage.tmp",
2121
`Coverage file. Required. File name, including the path, of the coverage results from go test.`,
2222
)
2323

0 commit comments

Comments
 (0)