Commit 1dcf4ec
authored
feat: Add samber/lo for functional collection utilities (#191)
* feat: Add samber/lo for functional collection utilities
Add samber/lo v1.52.0 which provides type-safe generic collection
operations including Map, Filter, Reduce, GroupBy, Find, and more.
This complements samber/mo (PR #189) which provides monadic types:
- samber/mo: Option, Result, Either, Future, IO
- samber/lo: Map, Filter, Reduce, GroupBy, Flatten, etc.
Together they provide a complete functional programming toolkit for Go
with compile-time type safety via generics.
* refactor: Use samber/lo for collection operations
Apply samber/lo to improve code clarity and type safety:
- payment-order/service: Use lo.Map for PaymentOrder slice transformation
- position-keeping/repository: Use lo.Filter for audit entry filtering
- platform/observability: Use lo.Keys for metadata carrier keys
These changes demonstrate the practical value of the samber/lo library
by replacing manual loops with expressive, type-safe functional operations.
* style: Fix import formatting
---------
Co-authored-by: Ben Coombs <[email protected]>1 parent f4b424e commit 1dcf4ec
File tree
5 files changed
+14
-18
lines changed- internal
- payment-order/service
- platform/observability
- position-keeping/repository
5 files changed
+14
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1255 | 1255 | | |
1256 | 1256 | | |
1257 | 1257 | | |
| 1258 | + | |
| 1259 | + | |
1258 | 1260 | | |
1259 | 1261 | | |
1260 | 1262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
1091 | 1092 | | |
1092 | 1093 | | |
1093 | 1094 | | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | 1095 | | |
1101 | | - | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
1102 | 1099 | | |
1103 | 1100 | | |
1104 | 1101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
459 | 460 | | |
460 | 461 | | |
461 | 462 | | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
| 463 | + | |
467 | 464 | | |
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
366 | 365 | | |
367 | 366 | | |
368 | 367 | | |
| |||
0 commit comments