Tags: enetx/g
Tags
refactor(print): replace .type/.debug/.wrap modifiers with format spe…
…c verbs
- Add print_fmt.go with Rust-style format mini-language ({:x}, {:>10.2}, {:+05}, etc.)
- Replace .type with {:T}, .debug with {:?}, .wrap with {:w} verb
- Support alignment (<, >, ^), fill, sign (+, -, space), zero-pad, width, precision
- Support verbs: x/X (hex), o (octal), b (binary), e/E (exponential), ? (#? pretty), T, p, w
feat(option): add Filter, Or, OrElse, IsSomeAnd and mutating methods - Add Filter for conditional value filtering - Add Or/OrElse for providing fallback Options - Add IsSomeAnd to check value against predicate - Add Insert, GetOrInsert(+With) for mutable value management - Add Take and Replace for value extraction/swap - Add OkOr/OkOrElse to convert Option to Result - Add FromPtr and Ptr for pointer conversions
feat(hash,bytes,string): add HMAC, raw digests, Hex, and Base64 variants - Add Bytes.Hex() for hex encoding raw bytes - Refactor bytesHasher → rawHasher to separate digest from hex encoding - Add *Raw() variants for MD5/SHA1/SHA256/SHA512 returning raw digests - Add HMACSHA256/HMACSHA512 (hex) and HMACSHA256Raw/HMACSHA512Raw for Bytes and String - Add Base64Raw, Base64URL, Base64RawURL encode/decode variants to String
feat(print): add {wrap} modifier to Errorf for error chain support
Errorf now supports a {wrap} modifier that simultaneously formats an
error value into the message and wraps it in the returned error,
enabling errors.Is / errors.As to traverse the chain.
Supported forms:
{.wrap} — auto-index
{1.wrap} — positional
{name.wrap} — named
multiple {wrap} references wrap multiple errors
Add wrappedError type (Unwrap() []error) to errors.go.
Add TestErrorf covering all forms and edge cases.
Add examples/print/ with basic, format, and errorf examples.
PreviousNext