We should return an error here:
|
// FormatManifest returns the file version manifest in json or csv format |
|
func FormatManifest(fileVersions map[string]string, format string) ([]byte, error) { |
|
if format == "json" { |
|
return json.MarshalIndent(fileVersions, "", " ") |
|
} |
|
if format == "csv" { |
|
b := &bytes.Buffer{} |
|
wr := csv.NewWriter(b) |
|
for filename, uri := range fileVersions { |
|
row := []string{filename, uri} |
|
wr.Write(row) |
|
} |
|
wr.Flush() |
|
return b.Bytes(), nil |
|
} |
|
return nil, nil |
|
} |
We should return an error here:
buffer-static-upload/main.go
Lines 195 to 211 in e7db242