Skip to content

Commit

Permalink
output/csv: Restored json config with snake_case fields
Browse files Browse the repository at this point in the history
This partially reverts commit e8886ac.
  • Loading branch information
codebien committed Oct 16, 2023
1 parent e8886ac commit 18e1b01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions output/csv/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import (

// Config is the config for the csv output
type Config struct {
FileName null.String `json:"fileName" envconfig:"K6_CSV_FILENAME"`
SaveInterval types.NullDuration `json:"saveInterval" envconfig:"K6_CSV_SAVE_INTERVAL"`
TimeFormat null.String `json:"timeFormat" envconfig:"K6_CSV_TIME_FORMAT"`
// Samples.
FileName null.String `json:"file_name" envconfig:"K6_CSV_FILENAME"`
SaveInterval types.NullDuration `json:"save_interval" envconfig:"K6_CSV_SAVE_INTERVAL"`
TimeFormat null.String `json:"time_format" envconfig:"K6_CSV_TIME_FORMAT"`
}

// TimeFormat custom enum type
Expand Down Expand Up @@ -83,7 +84,6 @@ func ParseArg(arg string, logger logrus.FieldLogger) (Config, error) {
c.FileName = null.StringFrom(r[1])
case "timeFormat":
c.TimeFormat = null.StringFrom(r[1])

default:
return c, fmt.Errorf("unknown key %q as argument for csv output", r[0])
}
Expand Down

0 comments on commit 18e1b01

Please sign in to comment.