---
title: "Go toolchain changes in Go 1.21+"
publication: "Go Weekly"
issue: 464
published_at: "2023-06-13"
canonical_url: "https://golangweekly.com/issues/464"
---

Plus talking to Matt Boyle about DDD, Ebitengine turns 10, and building traffic lights and fractals with Go. |        

#​464 — June 13, 2023 

[Unsub](https://golangweekly.com/leave/*|UID|*)|[Web Version](https://golangweekly.com/issues/464)   

✍️ If you're intrigued about domain-driven design (DDD), we've got an interview with Matt Boyle, the author of _Domain-Driven Design with Go_ – it's at the end of today's issue.
__
_Your editor, Peter Cooper_ 

Together with [![Ardan Labs\](https://res.cloudinary.com/cpress/image/upload/e_make_transparent/co_white,e_outline:7,q_auto/uf5bdgdgdbgcbdrzi6r7.png)](https://www.ardanlabs.com/consulting/?utm_source=cooperpress)  

Go Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/xy2stanrdttknah8ne6w.jpg)](https://go.dev/doc/toolchain)  

[An Update on Go Toolchains](https://go.dev/doc/toolchain) — Russ Cox [noted](https://github.com/golang/go/issues/57001#issue-1469986510) that _“many people believe the `go` line in the `go.mod` file specifies which Go toolchain to use.”_ Not so.. but from Go 1.21 the `go` command will use its own bundled toolchain _if_ that toolchain is at least as new as the `go` or `toolchain` lines in the module/workspace. If the toolchain is outdated, the newer version will be obtained. The official docs have been significantly extended to explain the situation. 

Official Go Site   

🎉 [Ebitengine's Game Jam to Celebrate Its 10th Birthday](https://itch.io/jam/ebitengine-game-jam-2023) — Beginning this Thursday, this game jam is a two-week event encouraging participants to build games with Go's popular [Ebitengine 2D game library.](https://ebitengine.org/) Formerly known as Ebiten, Ebitengine has turned 10 years old and supports a variety of platforms including the Nintendo Switch. 

Siôn le Roux and Hajime Hoshi   [![\](https://copm.s3.amazonaws.com/bcc68a3c.png)](https://www.ardanlabs.com/consulting/?utm_source=cooperpress) 

[Go! Experts at Your Service](https://www.ardanlabs.com/consulting/?utm_source=cooperpress) — Do you need help filling skill gaps, speeding up development & creating high performing software with Go, Docker, K8s, Terraform and Rust? We’ll help you maximize your architecture, structure, tech-debt and human capital. 

Ardan Labs Consulting sponsor   

[Writing a Go Fuzz Target](https://bitfieldconsulting.com/golang/fuzz-target) — The third in a four-part series on random and fuzz-testing. John breaks down a simple, but complete, fuzz test to show the right way to do things, in this case to surface a common kind of Go bug: accidentally mixing up bytes with runes. 

John Arundel (Bitfield Consulting)   

[Caching Go Tests in CI](https://www.airplane.dev/blog/caching-golang-tests-in-ci) — As the number of tests in their monorepo increased, this team’s test-related CI workflows got slower and slower, but Go’s test caching features helped turn things around getting times down from minutes to seconds in many cases. 

Benjamin Yolken   

[Using Pointers to Reduce Copies is Premature Optimization?](https://trinitroglycerin.github.io/2023/06/10/Go-Using-pointers-to-reduce-copies-is-premature-optimization/) — Is using pointers to avoid values being copied onto the stack _always_ a win when dealing with large amounts of data? It’s another “it depends” situation, but it’s not something you should immediately reach for as a _default._ 

Dan the Individual   

**IN BRIEF:** 

- [Go 1.20.5 and 1.19.10](https://groups.google.com/g/golang-announce/c/q5135a9d924/m/j0ZoAJOHAwAJ) were released including three security fixes.
- Should Go have [a built-in `zero` function](https://github.com/golang/go/issues/60695) to get the _zero value_ of a type? _(e.g. `""` for strings, `false` for booleans, `0` for numeric types..)_ No-one seems very convinced so far.    

[Scrubbing Sensitive Data at 180MB/Sec/Core](https://encore.dev/blog/scrubbing-sensitive-data) — To protect sensitive data, Encore implemented a streaming ‘scrubber’ for JSON data that uses static analysis to determine which fields need to be scrubbed. Their approach is fast even _“without any serious optimization effort put in.”_ 

Dominic Black (Encore)   

[Raspberry Pi Coding in Go: Traffic Lights](https://simonprickett.dev/raspberry-pi-coding-in-go-traffic-lights/) — As you might expect, this is more about setup and cross-compiling (plus you need [some actual lights](https://lowvoltagelabs.com/products/pi-traffic/)), but working with Raspberry Pis is always interesting and Go is a reasonable fit here. 

Simon Prickett   

[Troubleshooting Kubernetes Networking Issues](https://goteleport.com/blog/troubleshooting-kubernetes-networking/?utm_campaign=0426K8sBlog&utm_medium=partner&utm_source=golang) — First of a series of blogs on the most common failures we've encountered with Kubernetes across a variety of deployments. 

Teleport | goteleport.com sponsor   

[Process Huge Log Files with Go vs Python](https://www.madhur.co.in/blog/2023/06/10/processing-huge-log-files.html) — With several gigabytes of logs to process and with Python taking a long time to do it, Madhur gave Go a try and came away pleasantly surprised with the performance difference. 

Madhur Ahuja  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/jltxsenw37yehiqnyma0.jpg)](https://github.com/geziyor/geziyor)  

[Geziyor: A Web Crawling and Scraping Framework](https://github.com/geziyor/geziyor) — Boasts being able to crawl at many thousands requests per second and offers JavaScript rendering, caching, concurrency limits, automatic data exporting, proxy management, and more. 

Musab Gültekin   

[Compress: Optimized Compression Packages](https://github.com/klauspost/compress) — Covers a variety of compression standards like zstandard, S2, gzip, snappy, and zip. 

Klaus Post   

[gotestsum 1.10: `go test` Runner with Optimized Output and Summaries](https://github.com/gotestyourself/gotestsum) — Adds some niceties over the top of `go test` with a ‘watch’ mode to re-run tests when files are updated, the ability to run a command after a run (perhaps for an OS notification), and more human friendly test output along with a summary of each run. 

Daniel Nephin et al.   

[Temporal 101 & 102 Courses in Go](https://t.mp/temporal-courses) — Learn Temporal's open source key concepts and best practices with our free self-paced training courses in Go! 

Temporal Technologies sponsor   

[A Repo to Use for Go Interview Prep](https://github.com/MatthewJamesBoyle/golang-interview-prep) — Getting ready to apply for a Go position? Matt Boyle has built this repo for you to practice on: _“It’s a simple CRUD application but it has lots of smelly code, some security issues and poor design choices. Can you spot them all?”_ 

Matt Boyle   

💡 We also feature an interview with Matt on domain driven design, below.  

[Rapid 1.0: Property-Based Testing Library](https://github.com/flyingmutant/rapid) — Checks that properties you define hold for a large number of automatically generated test cases. If a failure is found, Rapid automatically minimizes the failing test case before presenting it. 

Gregory Petrosyan   

[Spectagular: Spectacular Struct Tag Parsing](https://github.com/matt1484/spectagular) — _“In general it’s not very often you need to parse struct tags, but if you do this library is designed to help by automatically converting struct tags to their expected value as well as cache/validate said values.”_ 

Matthew Abrego   

- [GoCV 0.33](https://github.com/hybridgroup/gocv/releases/tag/v0.33.0) – Computer vision with OpenCV 4.
- [gocryptfs 2.4](https://github.com/rfjakob/gocryptfs) – Encrypted overlay filesystem.
- [Bloom 3.5](https://github.com/bits-and-blooms/bloom) – Bloom filter implementation.
- [Mockery 2.29](https://github.com/vektra/mockery) – Mock codegen for Go.
- [certmagic 0.18](https://github.com/caddyserver/certmagic) – Automatic HTTPS for any Go app.
- [Gdu / go DiskUsage() 5.25](https://github.com/dundee/gdu)
 ↳ Fast disk usage analyzer.        ![Matthew Boyle](https://res.cloudinary.com/cpress/image/upload/w_200,e_sharpen:60/f8hz1v2ce2ou1185zdbv.jpg) 

Talking about DDD with...
Matthew Boyle  

[Matthew Boyle](https://mattjamesboyle.com/) is an experienced technical leader in the field of distributed systems, specializing in using Go. 

Currently an engineering manager at Cloudflare, but with enterprise and startup experience alike, he's the author of [_Domain-Driven Design with Go_](https://www.packtpub.com/product/domain-driven-design-with-golang/9781804613450) (published by Packt and also available [from Amazon](https://www.amazon.com/Domain-Driven-Design-Golang-maintainable-business/dp/1804613452)). 

Can you _sell_ [Domain-Driven Design](https://en.wikipedia.org/wiki/Domain-driven_design) to us in a single paragraph? 

Domain-Driven Design (DDD) is about ensuring your software matches the real-world problem space you’re designing for. This is powerful as it enables clearer communication with both technical and non-technical colleagues, typically leads to faster software development cycles and makes your software less brittle; meaning you can adapt it to new requirements. 

What advice would you give to developers who are new to DDD and want to start incorporating it into their projects? 

If there's one thing you take away from my book, it’s that DDD does not need to be "all or nothing" and you can be pragmatic about it. DDD promotes something called [“ubiquitous language”](https://martinfowler.com/bliki/UbiquitousLanguage.html) which suggests that when specific words are used by your team, there should be no doubt about what they mean. An example of this is the term "user". If I ask marketing what a user is and an engineer what a user is, will they give the same answer? 

By creating and publishing a definition for terms such as this that our team agrees on, we can ensure we're aligned. It also will make our code more robust as when we use the term "user", everyone will know exactly what we mean. 

Can you share anything about the process of adopting DDD concepts, traditionally associated with OOP, to a more idiomatically Go approach? 

I found a lot of the patterns translate fairly easily. For example, adapter patterns and the Open Host Service. Some things like the factory pattern tend to be less widely used in Go. In my book, I did my best to explain each pattern and call out the trade offs that are being made to make it work but I’m certainly open to challenge on it so please get in touch if you think I got it wrong! 

In [a recent post](https://mattjamesboyle.com/posts/milestone-first-book-published/) about writing the book, you expressed apprehension about taking on the responsibility of writing a book. Now it's done, how does it feel? 

I had always wanted to write a book and will always be grateful for the opportunity to do so. It has also given me more opportunities since, such as this interview or appearing on the [Go Time podcast](https://changelog.com/gotime) and enabled me to engage more with folks in the Go community I look up to such as Mat Ryer, Jon Calhoun and Bill Kennedy. 

Writing the book is one of the best things I have ever done professionally and I'd encourage others to give it a go!   

_Matt has been writing Go for production since 2018 and often shares blog posts and fun trivia about Go over on Twitter ([@MattJamesBoyle](https://twitter.com/MattJamesBoyle))._    

ƛ And one for fun.. 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/zmt7w3yk35bkfsdds6co.jpg)](https://github.com/joweich/fractals)  

[A Fast Mandelbrot Set Renderer using Goroutines](https://github.com/joweich/fractals) — A little off the usually trodden path but the output looks fantastic, and it’s a cool demonstration of bringing together some math, image creation, and concurrency. 

Jonas Weich    

Jobs  

[Join the Gno.land Team](https://docs.google.com/forms/d/e/1FAIpQLSexAk7JObOd6FSQXm6Qx91DXYKCgqo65NXdRIZXn6-EatL4Ew/viewform) — Get to gno us! Sign up for a Q&A with our team to learn about joining Gno.land and building the next-gen smart contract platform. 
Gno.land   

[Find a Job Through Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-golangweekly%29&utm_content=find-your-next-job) — Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now. 
Hired           

Curated by Peter Cooper and [Glenn Goodrich](https://twitter.com/ruprict). 

[Change your email](https://golangweekly.com/edit_subscription/*|UID|*)
[Stop getting this newsletter](https://golangweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
