Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I used generics for unmarshalling data structures with inner structure that was an interface{} into the generic structure Works really fine! https://github.com/acouvreur/tinykv
So far, just refactoring. I made a concurrency manager to simplify some stuff, and unified some pagination code. It’s like we said before generics: there are places you miss it, but not having it was never a total blocker. I think going working the x/slices x/maps packages will be the biggest time savers.
So far, just refactoring. I made a concurrency manager to simplify some stuff, and unified some pagination code. It’s like we said before generics: there are places you miss it, but not having it was never a total blocker. I think going working the x/slices x/maps packages will be the biggest time savers.
So far, literally just this: https://github.com/skillian/workers. Essentially just a function that gets a channel of "requests" and returns a channel of results that gets closed the then channel of requests is closed or a context is cancelled. That's literally it!
I'm writing a CLI parsing library, and generics have let me consolidate most of the flag value functionality for different types. So the flags for dbz --level 9000 --type superSaiyan share most of the same code even though one is an int and one is a string. So much fewer copy-paste-modify lines of code now!
Search: https://github.com/moov-io/watchman/blob/master/cmd/server/search_us_csl.go
I've had to make some changes to our linter because of this. golangci-lint has disabled many of the linters, which helps until they're all updated. We've still had to force golangci-lint to use the correct Go version.
Unfortunately we are still waiting for the linters we use to be ready for 1.18.
Extracting some map patterns I have been using in several projects.