From ba961f83e4af276e32f501e5b1845ee864d340df Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 18 May 2026 03:17:57 +0000 Subject: object/typ: Reformat a bit --- object/typ/doc.go | 4 ++-- object/typ/errors.go | 2 +- object/typ/type_details.go | 8 ++++---- object/typ/type_ops.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/object/typ/doc.go b/object/typ/doc.go index 155d60eb..04b487dc 100644 --- a/object/typ/doc.go +++ b/object/typ/doc.go @@ -1,5 +1,5 @@ // Package typ provides Git object type enums and names. -// +package typ + // I would prefer naming this package "type" // if it wasn't a keyword. -package typ diff --git a/object/typ/errors.go b/object/typ/errors.go index 8a442db0..6df43222 100644 --- a/object/typ/errors.go +++ b/object/typ/errors.go @@ -2,4 +2,4 @@ package typ import "errors" -var ErrInvalidType = errors.New("object/typ: Invalid type") \ No newline at end of file +var ErrInvalidType = errors.New("object/typ: Invalid type") diff --git a/object/typ/type_details.go b/object/typ/type_details.go index f8a18837..83938765 100644 --- a/object/typ/type_details.go +++ b/object/typ/type_details.go @@ -10,10 +10,10 @@ func (ty Type) details() typeDetails { //nolint:gochecknoglobals var typeTable = [...]typeDetails{ - TypeCommit: {name: "commit"}, - TypeTree: {name: "tree"}, - TypeBlob: {name: "blob"}, - TypeTag: {name: "tag"}, + TypeCommit: {name: "commit"}, + TypeTree: {name: "tree"}, + TypeBlob: {name: "blob"}, + TypeTag: {name: "tag"}, } //nolint:gochecknoglobals diff --git a/object/typ/type_ops.go b/object/typ/type_ops.go index 81570ab8..aaebb0eb 100644 --- a/object/typ/type_ops.go +++ b/object/typ/type_ops.go @@ -1,6 +1,6 @@ package typ // Name returns the canonical Git object type name. -func (ty Type) Name() (string) { +func (ty Type) Name() string { return ty.details().name } -- cgit v1.3.1-10-gc9f91