From 43c25d457becb64ed2f76fbe2935475056a1081a Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 16 Nov 2025 00:00:00 +0000 Subject: Documentation overhaul --- hash.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hash.go') diff --git a/hash.go b/hash.go index 98c36c2e..2278f7cc 100644 --- a/hash.go +++ b/hash.go @@ -8,7 +8,7 @@ import ( const maxHashSize = 32 -// Hash represents a Git object identifier. +// Hash represents a Git object ID. type Hash struct { data [maxHashSize]byte size int @@ -35,12 +35,12 @@ var hashFuncs = map[int]hashFunc{ }, } -// String returns the ID as hex using its internal size. +// String returns a hexadecimal string representation of the hash. func (hash Hash) String() string { return hex.EncodeToString(hash.data[:hash.size]) } -// Bytes returns a mutable copy of the underlying bytes using its internal size. +// Bytes returns a mutable copy of the hash bytes. func (hash Hash) Bytes() []byte { return append([]byte(nil), hash.data[:hash.size]...) } -- cgit v1.3.1-10-gc9f91