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.
perf: optimize deque, heap, map, slice, and string internals - Deque: extract copyToContiguous helper using copy/clear builtins, replace per-element realIndex loops with direct range slices in Iter, Contains, and String; bulk-copy in DequeOf, Clone, Reserve, ShrinkToFit, MakeContiguous, Slice - Heap: switch to heapify for bulk Push (O(n) vs O(n log n)) - Map: build MapOrd via direct append instead of Insert in Ordered() - MapOrd: replace iterator chains with direct loops and pre-allocated slices in Map, Safe, Keys, Values - Slice: remove closure in SubSlice loop condition; two explicit loops - Slice.Iter: use copy instead of SeqSlice.Collect in SeqSlices.Collect - String: cache .Std() conversions outside hot loops in Chunks, Truncate, writePadding; use rand.N + []byte for default Random charset; inline f.Contains/StartsWith/EndsWith as strings.* - f: cache type conversions outside closures in Contains, ContainsAnyChars, StartsWith, EndsWith - Tests: add TestMapOrdKeys, TestMapOrdToMap, TestMapOrdToSafe
PreviousNext