What’s New in Go 1.20, Part I: Language Changes

Well, it’s that time once again. It’s time for a new release of the Go programming language. Go 1.18 in Q1 of 2022 was a major release that featured the long awaited addition of generics to the language and also had lots of minor features and quality of life improvements. Go 1.19 in Q3 of 2022 was a comparatively subdued release. Now it’s 2023, and it’s time for Go 1.20. The release candidates have been released, and the final release is just around the corner. The Go team have already posted the draft release notes.

In my view, the impact of Go 1.20 is somewhere in between 1.18 and 1.19, with more features and solutions to longstanding problems than 1.19, but nothing on the scale of adding generics to the language in 1.18. Still, I’m going to break up my look at “What’s New in Go 1.20” into a planned series of three blog posts. First, I’ll write about the language changes in Go 1.20 (below), and in the next post, I’ll write about the major changes to the standard library, and finally there will be a last post about some of my favorite minor additions to the standard library.

Read more…

Review: The This by Adam Roberts

I had a friend in college who was very good at quitting smoking. Every weekend, she would smoke at parties, and every Monday, she would quit smoking once again.

For me, quitting Twitter was more like Hemmingway’s going broke: slowly then all at once.

Slowly, I created a professional account, moved the alt account using my teenage AIM screen name to private, and juggled which devices (laptop, phone, tablet) were able to access which accounts under which screen names at which times with what screen time limits. And then all at once I stopped reading any of my Tweeter feeds, thanks pretty much entirely due to reading the first two chapters of The This by Adam Roberts.

Read more…

What’s new in Go 1.19?

Update: Want to listen to a podcast about Go 1.19 instead of reading a blog post? Check out Go Time episode 240.

Go 1.18 was a big release with huge features like generics, fuzzing, and workspaces. There was plenty of excitement around its minor or even ultra-minor features. Go 1.19 is not a release on that scale. But it does pack in a lot of small improvements that can help the average Go developer. Let’s take a look at what some of them are.

Read more…

Even More Minor Features in Go 1.18

Go 1.18 was just released, bringing with it generics, fuzzing, and workspaces. Those are major features people have been asking about for years, but my last post about the minor features of Go 1.18 was an unexpected hit, so I’m following up on popular demand by bring you three even more minor features of Go. Get excited for some very small improvements to Go!

Read more…

Link: FOSDEM · Mastering Your Error Domain

I gave a talk at FOSDEM 2022 based on my post on using errors.As. Here is the abstract:

Error handling is one of Go’s key features. The errors.As helper added in Go 1.13 gives Gophers the tools they need to build their own error domains and ensure that all errors are handled properly across their applications.

The errors.As feature of Go 1.13 makes it easy to create error systems that work for your particular applications, users, and operators without being straitjacketed by the language into a one-size-fits-all approach that inadvertently exposes users to the internal operations of your system. Don’t let your end users be distracted by irrelevant warning messages. Handle errors properly by thinking about their roles and domain within your application.

Three Minor Features in Go 1.18

Everyone is excited that after a decade or so of devs asking for generics, the Go programming language is getting generic types and functions in Go 1.18 in Q1 2022. Generics are no doubt going to lead to a lot of experiments, some good, some bad, some just weird. Go 1.18 is also poised to lead to an increase in software reliability by including fuzzing as part of the standard testing package. But today, I want to look at some minor changes in Go 1.18 that might otherwise get lost in all the excitement around the marquee features.

Read more…