aboutsummaryrefslogtreecommitdiffhomepage
path: root/output
diff options
context:
space:
mode:
Diffstat (limited to 'output')
-rw-r--r--output/outputFormat.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/output/outputFormat.go b/output/outputFormat.go
index ec1838b39..9b1f83854 100644
--- a/output/outputFormat.go
+++ b/output/outputFormat.go
@@ -331,19 +331,20 @@ func decode(mediaTypes media.Types, input, output interface{}) error {
return decoder.Decode(input)
}
-// BaseFilename returns the base filename of formats.
-func (formats Format) BaseFilename() string {
- return formats.BaseName + formats.MediaType.FullSuffix()
+// BaseFilename returns the base filename of f including an extension (ie.
+// "index.xml").
+func (f Format) BaseFilename() string {
+ return f.BaseName + f.MediaType.FullSuffix()
}
-// MarshalJSON returns the JSON encoding of formats.
-func (formats Format) MarshalJSON() ([]byte, error) {
+// MarshalJSON returns the JSON encoding of f.
+func (f Format) MarshalJSON() ([]byte, error) {
type Alias Format
return json.Marshal(&struct {
MediaType string
Alias
}{
- MediaType: formats.MediaType.String(),
- Alias: (Alias)(formats),
+ MediaType: f.MediaType.String(),
+ Alias: (Alias)(f),
})
}