(no title)
hambos22 | 2 years ago
Till that day comes, you could use the "lo" library (inspired from lodash). It's my goto Swiss army knife for golang projects.
hambos22 | 2 years ago
Till that day comes, you could use the "lo" library (inspired from lodash). It's my goto Swiss army knife for golang projects.
puika|2 years ago
shirogane86x|2 years ago
At least in my job(s over the years), turning a flat list of db records into a more complex, nested (potentially on multiple levels) data structure before handing it off to the front-end is a very common. I've seen it done with "simple, fast code" (although not in go specifically, but in other languages), but it very quickly turned into huge messes of of long nested for loops and was very difficult to read. LINQ, Lodash, java's streams... I sincerely can't understand how go developers live without them. They make me a lot more productive both at reading and writing the code.
gwd|2 years ago
Zach_the_Lizard|2 years ago
`context` also helps solve a bunch of the channel related use cases in a more elegant (IMO) way.
There are only a handful of things in that package I wish were included, such as "Keys()" on a map.
mplanchard|2 years ago
c2xlZXB5Cg1|2 years ago
Cthulhu_|2 years ago
stpedgwdgfhgdd|2 years ago
https://pkg.go.dev/slices