aboutsummaryrefslogtreecommitdiff
path: root/ident.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2025-11-16 00:00:00 +0000
committerGravatar Runxi Yu2025-11-16 00:00:00 +0000
commitd944abb28ea70d98d36598a1f30c3738a431013e (patch)
tree23347a489b7668cbc2d754ecc2c010acfde0b7d0 /ident.go
parentRename ObjType -> ObjectType (diff)
signature
All Serialize should be able to error out
Diffstat (limited to 'ident.go')
-rw-r--r--ident.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/ident.go b/ident.go
index 1d756695..5a01d8ea 100644
--- a/ident.go
+++ b/ident.go
@@ -94,7 +94,7 @@ func parseIdent(line []byte) (*Ident, error) {
}
// Serialize renders an Ident into canonical Git format.
-func (ident Ident) Serialize() []byte {
+func (ident Ident) Serialize() ([]byte, error) {
var b strings.Builder
b.Grow(len(ident.Name) + len(ident.Email) + 32)
b.Write(ident.Name)
@@ -113,7 +113,7 @@ func (ident Ident) Serialize() []byte {
hh := offset / 60
mm := offset % 60
fmt.Fprintf(&b, "%c%02d%02d", sign, hh, mm)
- return []byte(b.String())
+ return []byte(b.String()), nil
}
// When returns the timestamp as time.Time using the embedded offset.