Skip to content

Commit

Permalink
fix: create output file if it does not exist (#389)
Browse files Browse the repository at this point in the history
* fix: create output file if it does not exist

Signed-off-by: Felipe Zipitria <[email protected]>

* fix: use log instead to have a clean output file

Signed-off-by: Felipe Zipitria <[email protected]>

---------

Signed-off-by: Felipe Zipitria <[email protected]>
  • Loading branch information
fzipi authored Nov 4, 2024
1 parent 97d953e commit 18e3472
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/quantitative.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func runQuantitativeE(cmd *cobra.Command, _ []string) error {
if outputFilename == "" {
outputFile = os.Stdout
} else {
outputFile, err = os.Open(outputFilename)
outputFile, err = os.OpenFile(outputFilename, os.O_RDWR|os.O_CREATE, 0644)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/quantitative/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Params struct {
// RunQuantitativeTests runs all quantitative tests
func RunQuantitativeTests(params Params, out *output.Output) error {
var lc corpus.File
out.Println(":hourglass: Running quantitative tests with %d goroutines", params.MaxConcurrency)
log.Info().Msgf("⏳Running quantitative tests with %d goroutines", params.MaxConcurrency)
log.Trace().Msgf("Rule: %d", params.Rule)
log.Trace().Msgf("Payload: %s", params.Payload)
log.Trace().Msgf("Directory: %s", params.Directory)
Expand Down

0 comments on commit 18e3472

Please sign in to comment.