refactor: output config usages

main
sundowndev 2021-09-07 15:43:40 +02:00
parent 199259eb3d
commit 6e48f177c3
2 changed files with 7 additions and 13 deletions

View File

@ -8,5 +8,5 @@ type OutputConfig struct {
}
func (o *OutputConfig) String() string {
return fmt.Sprintf("%s://%s", o.Key, o.Options["path"])
return fmt.Sprintf("%s://%s", o.Key, o.Path)
}

View File

@ -302,22 +302,16 @@ func Test_parseOutputFlag(t *testing.T) {
},
want: []output.OutputConfig{
{
Key: "json",
Options: map[string]string{
"path": "result1.json",
},
Key: "json",
Path: "result1.json",
},
{
Key: "json",
Options: map[string]string{
"path": "result2.json",
},
Key: "json",
Path: "result2.json",
},
{
Key: "json",
Options: map[string]string{
"path": "result3.json",
},
Key: "json",
Path: "result3.json",
},
},
err: nil,