We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f5394b commit b7a8cc9Copy full SHA for b7a8cc9
id/uuid.go
@@ -45,7 +45,7 @@ func (u Base64UUID[U]) MarshalJSON() ([]byte, error) {
45
if sub, err := u.AppendText(b[1:]); err != nil {
46
return nil, err
47
} else {
48
- b = b[:len(sub)+1]
+ b = b[:len(sub)+1] // the appended text plus the " character.
49
}
50
b = append(b, '"')
51
@@ -64,7 +64,7 @@ func (u *Base64UUID[U]) UnmarshalJSON(b []byte) error {
64
65
func (u Base64UUID[U]) AppendText(b []byte) ([]byte, error) {
66
b = slices.Grow(b, base64UUIDEncodedLen)
67
- b = b[:len(b)+base64UUIDEncodedLen]
+ b = b[:len(b)+base64UUIDEncodedLen] // safe since we already grew the buffer.
68
Base64.Encode(b, u.Value[:])
69
return b, nil
70
0 commit comments