aboutsummaryrefslogtreecommitdiff
path: root/object/signature/bytes.go
diff options
context:
space:
mode:
Diffstat (limited to 'object/signature/bytes.go')
-rw-r--r--object/signature/bytes.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/object/signature/bytes.go b/object/signature/bytes.go
deleted file mode 100644
index 0afff5e0..00000000
--- a/object/signature/bytes.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package signature
-
-import (
- "fmt"
- "strconv"
- "strings"
-)
-
-// Bytes renders the signature in canonical Git format.
-func (signature Signature) Bytes() ([]byte, error) {
- var b strings.Builder
- b.Grow(len(signature.Name) + len(signature.Email) + 32)
- b.Write(signature.Name)
- b.WriteString(" <")
- b.Write(signature.Email)
- b.WriteString("> ")
- b.WriteString(strconv.FormatInt(signature.WhenUnix, 10))
- b.WriteByte(' ')
-
- offset := signature.OffsetMinutes
-
- sign := '+'
- if offset < 0 {
- sign = '-'
- offset = -offset
- }
-
- hh := offset / 60
- mm := offset % 60
- fmt.Fprintf(&b, "%c%02d%02d", sign, hh, mm)
-
- return []byte(b.String()), nil
-}