Skip to content

Throw error for invalid manifest formatΒ #9

Open
@djfarrelly

Description

@djfarrelly

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions