diff options
| author | 2026-06-06 21:05:18 +0000 | |
|---|---|---|
| committer | 2026-06-06 21:05:18 +0000 | |
| commit | d0f52a812c32bd8227179322947e880a9a966a11 (patch) | |
| tree | f483edb05d78109c9792252bd0bbbc1bee5769d2 /object/id/object_format_parse.go | |
| parent | object/store: Go does not accept \0 (diff) | |
| signature | No signature | |
Various fixes and QoL things
Diffstat (limited to 'object/id/object_format_parse.go')
| -rw-r--r-- | object/id/object_format_parse.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/object/id/object_format_parse.go b/object/id/object_format_parse.go index 9e7401c7..521cbd89 100644 --- a/object/id/object_format_parse.go +++ b/object/id/object_format_parse.go @@ -1,8 +1,11 @@ package id // ParseObjectFormat parses a canonical object format name (e.g. "sha1", "sha256"). -func ParseObjectFormat(s string) (ObjectFormat, bool) { +func ParseObjectFormat(s string) (ObjectFormat, error) { objectFormat, ok := objectFormatByName[s] + if !ok { + return ObjectFormatUnknown, ErrInvalidObjectFormat + } - return objectFormat, ok + return objectFormat, nil } |
