Commit cb52c53
authored
refactor: use
Replaces use of `errors.As` with `errors.AsType`, a generic function introduced in Go 1.26 that unwraps errors in a type-safe way and returns a typed result directly.
Instead of declaring a separate variable and passing a pointer to it, `errors.AsType` returns a typed result directly. This makes the code shorter, easier to read, and avoids common mistakes related to incorrect pointer usage.
Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>errors.AsType (#510)1 parent 8264fb1 commit cb52c53
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
| 383 | + | |
385 | 384 | | |
386 | 385 | | |
387 | 386 | | |
| |||
0 commit comments