---
title: "Fixing Go's for loops, for real"
publication: "Go Weekly"
issue: 477
published_at: "2023-09-26"
canonical_url: "https://golangweekly.com/issues/477"
---

Plus we say hi to GopherCon 2023, GitHub's support for passkeys, and GoLand's latest EAP. |        

#​477 — September 26, 2023 

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

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/ili93rduppzbkoj5xhwk.jpg)](https://go.dev/doc/modules/layout)  

[Organizing a Go Module](https://go.dev/doc/modules/layout) — It’s common for Go developers to think about how to organize the files and directories in projects (some of our most popular links have been on this topic). The Go project itself has tended to be quiet on the topic and has let the community figure out best practices, which has [led to issues](https://github.com/golang-standards/project-layout/issues/117) in the past, so it’s nice to see them publish something more official now. 

The Go Team   [![\](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   

[Fixing `for` Loops in Go 1.22](https://go.dev/blog/loopvar-preview) — Go 1.21 includes a _preview_ of [a much-anticipated change to `for`-loop scoping](https://go.googlesource.com/proposal/+/master/design/60078-loopvar.md) that’s expected to ship fully in Go 1.22. This post shows off what will change and explains how such a significant change _won’t_ affect Go’s backwards compatibility, by only being applied to code specifically declaring that it targets Go 1.22 or later. 

David Chase and Russ Cox   

_QUICK BITS:_ 

- JetBrains has started the [Early Access Program for GoLand 2023.3.](https://blog.jetbrains.com/go/2023/09/25/the-goland-2023-3-early-access-program-has-started/) As always, these builds of the popular Go IDE are free to try, and give a glimpse at what's coming up in the next major version.
- [Support for Passkeys](https://github.blog/2023-09-21-passkeys-are-generally-available/) is now generally available when using GitHub.
- There's [a proposal for adding runtime/trace 'flight recording'](https://github.com/golang/go/issues/63185) to Go's runtime a la the _Java Flight Recorder._ The idea is to maintain a circular buffer of trace data in a low-overhead way that can be interrogated as needed.
- [TinyGo 0.30](https://github.com/tinygo-org/tinygo/releases/tag/v0.30.0) has been released which includes a switch to LLVM 16, support for Adafruit Gemma M0, and fixes for some bugs, just in time for GopherCon.
- And yes, [GopherCon 2023](https://www.gophercon.com/) is taking place _right now_ in San Diego, CA. If you're there, we hope you're having a great time! 👋   

[Failsafe: Fault Tolerance and Resilience Patterns](https://failsafe-go.dev/) — A new Go library for building fault-tolerant apps where you can wrap code in various resilience policies such as Retry, CircuitBreaker, RateLimiter, Timeout, and Fallback. It supports async execution, [cooperative cancellation](https://failsafe-go.dev/execution-cancellation/), and event listeners. 

Jonathan Halterman   

[GitHub Actions Could Be So Much Better](https://blog.yossarian.net/2023/09/22/GitHub-Actions-could-be-so-much-better) — _Actions_ is a useful service, but the developer experience leaves much to be desired. If you’ve been frustrated when setting up and debugging workflows, you’ll find much to nod along with. 

William Woodruff   

[How (Not) to Apply for a Software Job](https://benhoyt.com/writings/how-to-apply/) — Not Go specific, but one of our favorite Go bloggers. 

Ben Hoyt   

[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   

[Top 10 Tips for Instrumenting Go Apps with New Relic](https://newrelic.com/blog/how-to-relic/top-tips-golang-5) — While this is part five of a series, it’s the one that summarizes all ten tips in one place. 

Steve Ng (New Relic)   

[Replacing Python with Go and Reducing Our Docker Image Size by ~87%](https://dragondrop.cloud/2023/09/19/ripping-out-python-and-reducing-our-docker-image-size-by-87/) 
Dragondrop   

[Implementing Enumerations in Go](https://www.ardanlabs.com/blog/2023/09/implementing-enumerations-in-golang.html) 
William Kennedy  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/mvar82mt1hv137q2xono.jpg)](https://ebitengine.org/en/blog/v2.6.0.html)  

[Ebitengine v2.6.0: The 2D Game Engine](https://ebitengine.org/en/blog/v2.6.0.html) — [Ebitengine](https://ebitengine.org/) (formerly Ebiten) is the best known approach for building 2D games in Go that can run across numerous platforms (even including the Nintendo Switch). v2.6 improves Windows support, lets you control which monitor displays your game, provides a mouse cursor passthrough ability, [and more](https://ebitengine.org/en/documents/2.6.html). 

Hajime Hoshi   

[Encore: Developer Productivity Platform for Go Development](https://encore.dev/?utm_campaign=dpp2&utm_medium=email&utm_source=golangweekly) — Encore automates development tasks and infrastructure to shorten feedback loops, improve quality, and 2x productivity. 

Encore sponsor   

[Sonnet: A High(er) Performance JSON Library](https://github.com/sugawarayuuta/sonnet) — _“Fully compatible with the Go standard library, Both the encoder and the decoder passed all tests from it.”_ The author has benchmarks, but has also [written an explanatory post](https://sugawarayuuta.medium.com/my-high-performance-json-decoder-is-now-memory-safe-and-even-faster-97960f278e11) on his approach. 

Sugawara Yuuta   

[Afero 1.10: A Filesystem Abstraction System for Go](https://github.com/spf13/afero) — A single consistent API for accessing a variety of filesystems. Also lets you create mock and testing filesystems that don’t rely on disk at all. 

Steve Francia   

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

[Flameshow: A Terminal Flamegraph Viewer](https://github.com/laixintao/flameshow) — Before you whip out `go install`, bear in mind this tool is written in Python. Nonetheless, you get a capable terminal-based flamegraph renderer that, currently, _only_ supports Go’s pprof data. 

laixintao   

[automaxprocs: Automatically Set `GOMAXPROCS` to Match Linux Container CPU Quota](https://github.com/uber-go/automaxprocs) 

Uber Golang       

📰 Classifieds   

🎟️ [CityJS Berlin](https://berlin.cityjsconf.org): 1-3 November. 25 speakers including Tejas Kumar, Christian Heilmann, Rachel Nabors. Use `COMMUNITY` discount code to save 25% off. 

--- 

💻 [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.      

- [bitset 1.9](https://github.com/bits-and-blooms/bitset)
 ↳ Data structure to compactly store and access _bits._
- [Hertz 0.7](https://github.com/cloudwego/hertz)
 ↳ Framework for building HTTP microservices.
- [mo 1.10](https://github.com/samber/mo)
 ↳ Generics-powered monads & FP abstractions.
- [purego 0.5](https://github.com/ebitengine/purego)
 ↳ Call C functions from Go without Cgo.
- [GoAWK 1.25.0](https://github.com/benhoyt/goawk/releases/tag/v1.25.0)
 ↳ Go AWK intepreter with CSV support.
- [Podinfo 6.5](https://github.com/stefanprodan/podinfo)
 ↳ Go microservice template for Kubernetes.
- [AWS Lambda Go API Proxy 0.16.0](https://github.com/awslabs/aws-lambda-go-api-proxy)  

🤔 PHP? 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/i9s3py5kkgzhxz0quwj4.jpg)](https://dunglas.dev/2023/09/the-php-revolution-is-underway-frankenphp-1-0-beta/)   

[FrankenPHP 1.0 Beta: Another PHP App Server](https://dunglas.dev/2023/09/the-php-revolution-is-underway-frankenphp-1-0-beta/) — Your eyes do not deceive you. This is still Go Weekly, but [FrankenPHP](https://frankenphp.dev/) is a new app server for PHP, _written in Go_ and built on top of Caddy, that simplifies the deployment of PHP apps. If this idea sounds familiar, you may have encountered [RoadRunner](https://roadrunner.dev/), another Go-powered PHP app server that [takes a very different approach](https://news.ycombinator.com/item?id=33208167). 

Kévin Dunglas         

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
