Skip to content

Commit

Permalink
update base64 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zamicol committed May 25, 2023
1 parent cbeca65 commit b14bb3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base64.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

// Type B64 is a Coze addition to Go's base64. B64 is useful for marshaling and
// unmarshalling structs. B64's underlying type is []byte and is represented in
// JSON as base64 URI truncated (b64ut).
// JSON as "RFC 4648 base 64 URI canonical with padding truncated" (b64ut).
//
// When converting integers or other types to B64, `nil` is encoded as "" and
// zero is encoded as "AA".
Expand Down Expand Up @@ -46,7 +46,7 @@ func Decode(b64 string) (B64, error) {
return base64.URLEncoding.Strict().WithPadding(base64.NoPadding).DecodeString(b64)
}

// MustDecode decodes a b64ut string. Panics on error.
// MustDecode decodes b64ut and panics on error.
func MustDecode(b64 string) B64 {
b, err := base64.URLEncoding.Strict().WithPadding(base64.NoPadding).DecodeString(b64)
if err != nil {
Expand Down

0 comments on commit b14bb3f

Please sign in to comment.