-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd: added new output formats #93
Conversation
Current coverage is 61.31% (diff: 100%)@@ master #93 diff @@
==========================================
Files 36 40 +4
Lines 1606 1657 +51
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 965 1016 +51
Misses 582 582
Partials 59 59
|
} | ||
} | ||
|
||
func (cf *CsvFormat) Init(headers []string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These method names could look more standard:
Init -> WriteHeader
Line -> Write
End -> Close
} | ||
|
||
func (cf *JsonFormat) Line(line []interface{}) error { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line
}, | ||
} | ||
|
||
func TestFormats(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use separate functions for each format so that we have separate test output for them
Now you can change the output format to 2 new ones: json and csv. - Added json support - Added csv support - Now the table output format is called 'pretty'. It is the default format.
Now you can change the output format to 2 new ones: json and csv.