diff options
Diffstat (limited to 'object/parse.go')
| -rw-r--r-- | object/parse.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/object/parse.go b/object/parse.go index 81996206..f9779171 100644 --- a/object/parse.go +++ b/object/parse.go @@ -29,7 +29,7 @@ func ParseWithHeader(raw []byte, objectFormat id.ObjectFormat) (Object, error) { } body := raw[headerLen:] - if uint64(len(body)) != size { + if len(body) != size { return nil, fmt.Errorf("%w: header declares %d bytes, body has %d", ErrSizeMismatch, size, len(body)) } @@ -41,15 +41,15 @@ func ParseWithHeader(raw []byte, objectFormat id.ObjectFormat) (Object, error) { //nolint:ireturn func ParseWithoutHeader(ty typ.Type, body []byte, objectFormat id.ObjectFormat) (Object, error) { switch ty { - case typ.TypeBlob: + case typ.Blob: return blob.Parse(body) //nolint:wrapcheck - case typ.TypeTree: + case typ.Tree: return tree.Parse(body, objectFormat) //nolint:wrapcheck - case typ.TypeCommit: + case typ.Commit: return commit.Parse(body, objectFormat) //nolint:wrapcheck - case typ.TypeTag: + case typ.Tag: return tag.Parse(body, objectFormat) //nolint:wrapcheck - case typ.TypeUnknown: + case typ.Unknown: return nil, typ.ErrInvalidType default: return nil, typ.ErrInvalidType |
