ADd comments to OutputFormat exported funcs.

reviewable/pr2557/r6
Justin Scott 8 years ago
parent f7348e0c86
commit 86028454af

@ -113,12 +113,15 @@ func (opts *Options) valuesMap(m map[string]interface{}) (map[string]interface{}
return m, nil return m, nil
} }
// OutputFormat defines valid values for init output (json, yaml)
type OutputFormat string type OutputFormat string
// String returns the string value of the OutputFormat
func (f *OutputFormat) String() string { func (f *OutputFormat) String() string {
return string(*f) return string(*f)
} }
// Type returns the string value of the OutputFormat
func (f *OutputFormat) Type() string { func (f *OutputFormat) Type() string {
return "OutputFormat" return "OutputFormat"
} }
@ -128,6 +131,7 @@ const (
fmtYAML = "yaml" fmtYAML = "yaml"
) )
// Set validates and sets the value of the OutputFormat
func (f *OutputFormat) Set(s string) error { func (f *OutputFormat) Set(s string) error {
for _, of := range []OutputFormat{fmtJSON, fmtYAML} { for _, of := range []OutputFormat{fmtJSON, fmtYAML} {
if s == string(of) { if s == string(of) {

Loading…
Cancel
Save