Tags: mitranim/gg
Tags
goroutine-local storage (dynamic variables); other tweaks Added support for GLS: - `DynVar` - `GlsGo` - `GlsGo1` - `GlsRun` - `GlsRun1` - `GlsSet` - `GlsSnap` - `GlsClear` - `Gls` - `GlsVal` - `Gid` - `GidFunc` Also added an implementation of "stack ID", out of horrified fascination with the idea: - `Sid` - `WithSid` - `WithGivenSid` Other additions: - `Once` - `Catch1`: alias for Catch10 - `TypeName` - `SendZero` - `Chan.SendZero` - `gtest.MapEmpty` Breaking changes which may affect consumer code: - Renamed `Sum` to `SumBy`. - Added `Sum`: non-variadic version of `Plus`. - Dropped `SliceFrom` in favor of `Union`. Breaking changes not expected to affect consumer code: - `Trace` is now `[]uintptr` rather than `[]Caller`. `CaptureTrace` is no longer limited to 64 frames, and always returns the full trace after the skip. Improved `Atom`. Now uses `atomic.Pointer` instead of `atomic.Value`. This is now an extended version of `atomic.Pointer`, with shortcuts for storing copies of values. Unlike the previous implementation, this can store an interface value without panicking on inconsistent concrete types. Added missing `go:build` annotations to allow compilation on `arm` (the 32-bit version; arm64 always worked). Deprecation: `Lazy` and `NewLazy` are deprecated in favor of `Once`.
misc additions and tweaks Add `gg.Errs.Add`. Add `gg.ErrStr.Is`. Add `gg.OrdMap.Keys`. Add `gsql.ScanAnyOpt`. Add `gsql.ScanReflectOpt`. Improve `gsql.Arr` parsing (still incomplete). Properly elide `grepr.Conf.Pkg` from all type names. Minor breaking: drop `gg.Newline`. Minor breaking: drop `gg.Space`.
simplify "conc", "mem", fix num conversion, improve SQL scan Breaking: * Drop `gg.ConcSlice`. Just call `gg.Conc`. * Drop `gg.ConcRaceSlice`. Just call `gg.ConcRace`. * Drop `gg.Timed`. * All methods of `gg.Mem` which returned `gg.Timed` now simply return the inner value. * `gg.Mem` now treats zero duration as indefinite. * Drop `gg.Errs.LenNil`. * Drop `gg.Errs.LenNotNil`. * Drop `gg.Errs.IsEmpty`. * Rename `gg.Errs.IsNotEmpty` → `gg.Errs.HasErr`. Additions: * Add `gg.Errs.Count`. * Add `gg.DurForever`. * Add `gg.IsFrac`. * Add `gg.MinSafeIntFloat32`. * Add `gg.MaxSafeIntFloat32`. * Add `gg.MinSafeIntFloat64`. * Add `gg.MaxSafeIntFloat64`. Improvements: Fixed various false negatives and false positives in `gg.NumConv`. The function now explicitly tests the source number against known safe numeric ranges for the particular combination of source type and target type. `gsql.ScanAny` and `gsql.ScanReflect` now accept and support pointers to interface values hosting concrete values. Earlier versions treated interfaces as opaque scalars, without dereferencing to the underlying value. Interfaces without an underlying concrete type will continue failing to scan as before. Assuming a matching query, the following code should now work: ```go rows := gg.Try1(conn.QueryContext(ctx, someQuery)) defer gg.Close(rows) tar := any(struct{Id string `db:"id"`}{}) gsql.ScanAny(rows, &tar) ``` Slightly improved some error messages in `gtest`.
more slice functions, set methods, fixes * Add `gg.Set.IsEmpty`. * Add `gg.Set.IsNotEmpty`. * Add `gg.TakeLastWhile`. * Add `gg.Slice.TakeLastWhile`. * Add `gg.DropLastWhile`. * Add `gg.Slice.DropLastWhile`. * Add `gg.FindLastIndex`. * Add `gg.Slice.FindLastIndex`. * Add `gg.FindLast`. * Add `gg.Slice.FindLast`. * Add `gg.FoundLast`. * Add `gg.Slice.FoundLast`. * Bugfix `gg.TakeWhile`. * Bugfix `gg.DropWhile`.
PreviousNext