🔗 Go 1.14
Meetup #9 took place on Friday, February 21, 2020, 19:00 CEST at Basislager.
We looked at changes coming in the upcoming Go 1.14 release, which is is expected to be released in February 2020.
The slides can be found here:
There are many improvements, just one of them is lower-cost defer statements.
The proposal can be found here:
Recommended podcast: gotime/112.
🔗 HTTP Getaway
The net/http package offers many extension points, using interfaces or callbacks - as well as alternative implementations. A few examples are sketched out in HTTP Getaway.
Retry is a common pattern. Interestingly, application layer retries might not always be enough, sometimes only a connection reset will help.
🔗 Misc
- We discussed various ways to handle errors, there has been some updates starting with Go 1.13: Working with Errors in Go 1.13
- A popular testing library is stretchr/testify, e.g. helps to test code that panics. Maybe more lightweight - is.
- Speaking of panics: Shall libraries panic? In which cases? According to
Effective Go,
panic
should be an exception, rather the rule. - Pop quiz on modules: Is go.sum immutable? The docs say: “In day-to-day development, the checksum of a given module version should never change.” - however it can change, here’s an example commit: 766e40eb. More details can be found a blog series on modules, e.g. Part 4: Mirrors, Checksums and Athens.
- Three HTTP router libraries that seem to be popular: mux, chi, httprouter
- Combining io.Reader and Context can be useful to cancel an expensive read (e.g. large file) in an HTTP handler, here’s a description of context-aware IO.
- One cool project: kind, providing local clusters for testing Kubernetes. Given a docker with at least Go 1.11, starting a cluster becomes a one-liner:
GO111MODULE="on" go get sigs.k8s.io/kind@v0.7.0 && kind create cluster
- incredible. - 16 days ago, a new W3C recommendation was published, Trace Context Level 1, which defines standard HTTP headers and a value format to propagate context information that enables distributed tracing scenarios. The specification standardizes how context information is sent and modified between services. Context information uniquely identifies individual requests in a distributed system and also defines a means to add and propagate provider-specific context information.
And much more.
🔗 Contributing
We want to make it simpler to contribute and to stay up to date with our meetup and we may create a mailing list in the future.
Until then, please feel invited to:
- follow our RSS feed
- PR a topic
- contact us via Meetup or E-mail
- join us at GitHub at Leipzig Gophers org