---
title: "How Go 1.26 stack allocation optimizations beat hand-optimized code"
publication: "Go Weekly"
issue: 592
published_at: "2026-03-06"
canonical_url: "https://golangweekly.com/issues/592"
---

Plus two Go releases, secure error handling, and some added background to the generic methods story.        

#​592 — March 6, 2026 

[Read the Web Version](https://golangweekly.com/issues/592)  

Together with [![Tiger Data logo\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_1280,h_282/e_make_transparent/co_white,e_outline:30/px1u7kjyvz7xnbm6ytir.png)](https://www.tigerdata.com/timescaledb?utm_source=cooperpress&utm_medium=referral&utm_campaign=golang-weekly-newsletter)   

Go Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/dzbyashny6ulxoux1fht.jpg)](https://go.dev/blog/allocation-optimizations)  

[Allocating on the Stack in Go 1.25+](https://go.dev/blog/allocation-optimizations) — Go 1.25 and 1.26 reduce garbage collector overhead by stack-allocating slices in more cases than ever before — including, in 1.26, slices that eventually escape to the heap. _"The optimization that Go 1.26 does is actually better than the hand-optimized code"_ is always good to read. Let Keith explain how this all… _stacks up._ 

Keith Randall (Go Team)   [![\](https://res.cloudinary.com/cpress/image/upload/c_limit,w_480,h_480,q_auto/copm/1fe4efb3.png)](https://www.tigerdata.com/timescaledb?utm_source=cooperpress&utm_medium=referral&utm_campaign=golang-weekly-newsletter) 

[Keep Your Stack Simple. Extend Postgres](https://www.tigerdata.com/timescaledb?utm_source=cooperpress&utm_medium=referral&utm_campaign=golang-weekly-newsletter) — Adding a second database means pipelines, sync lag, and drift that never go away. TimescaleDB extends Postgres so analytics runs on live data. Hypertables, 95% compression, continuous aggregates. One database. [Start building for free](https://www.tigerdata.com/timescaledb?utm_source=cooperpress&utm_medium=referral&utm_campaign=golang-weekly-newsletter). 

Tiger Data (creators of TimescaleDB) sponsor   

[Go 1.26.1 and 1.25.8 Released](https://groups.google.com/g/golang-announce/c/EdhZqrQ98hk/m/41DopX_WAAAJ) — Security oriented releases incorporating five different fixes around `crypto/x509`, `html/template` (URLs in meta content attributes are not escaped), `net/url` and `os` (FileInfo can escape from a Root). 

Cherry and David (Go Team)   

[Mutate Your Locked State Inside a Closure](https://rednafi.com/go/mutex-closure/) — Even perfectly locked Go code can silently lose updates, and the race detector won’t catch it. Here’s how a small generic wrapper makes that class of bug harder to introduce. 

Redowan Delowar   

[Best Practices for Secure Error Handling in Go](https://blog.jetbrains.com/go/2026/03/02/secure-go-error-handling-best-practices/) — A look at some common patterns for safely creating, wrapping, propagating, and logging errors across trust boundaries including, at the end, how the GoLand IDE can help. 

Dominika Stankiewicz (JetBrains)   

▶[Why We Can't Have Nice Things: Generic Methods](https://www.youtube.com/watch?v=hP3GF60M-tQ) — **The proposal for generic methods has [since been accepted](https://github.com/golang/go/issues/77273#issuecomment-3962618141)**, but this newly-uploaded talk from 2025 gives some interesting background as to why it took so long to reach consensus on the matter. 

Axel Wagner   

[Build Reliable Systems with Go at Replay 2026](https://replay.temporal.io/?utm_source=newsletter&utm_medium=sponsorship&utm_campaign=newsletter-2026-03-06-go&utm_content=replay-2026-go) — Learn proven reliability patterns at scale and join the Go workshop to build with Temporal. Save with GO80. 

Temporal Technologies sponsor   

📄 [Why Go Can't `try`](https://niketpatel.com/essays/why-go-cant-try) – _“Go’s refusal to add a try keyword isn’t about loving boilerplate.”_ Niket Patel 

🤖 [Why Go is the Best Language for AI Agents](https://getbruin.com/blog/go-is-the-best-language-for-agents/) Burak Karakan 

📄 [Fooling Go's X.509 Certificate Verification](https://danielmangum.com/posts/fooling-go-x509-certificate-verification/) Daniel Mangum  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/ddgdk7bmzektqqszkdqz.jpg)](https://revive.run/)  

[Revive 1.15: A Faster, Configurable, Flexible Linter for Go](https://revive.run/) — A drop-in replacement of golint that aims to provide more structure, configurability, and performance that’s [used by numerous](https://github.com/mgechev/revive?tab=readme-ov-file#who-uses-revive) popular projects and libraries. [Its README](https://github.com/mgechev/revive#readme) does a good job of explaining how it differs from `golint`. 

Minko Gechev   

[ro: Streams and Reactive Programming for Go](https://ro.samber.dev/) — A Go implementation of the [ReactiveX](https://reactivex.io/) Observer pattern from the creator of [lo](https://github.com/samber/lo). [v0.3](https://github.com/samber/ro/releases/tag/v0.3.0) introduces a new SIMD plugin that uses Go 1.26’s experimental SIMD support for faster sums, min/max, reducing, etc. [GitHub repo.](https://github.com/samber/ro) 

Samuel Berthe   

💡 For that matter, the [latest version of `lo`](https://github.com/samber/lo/releases/tag/v1.53.0) also includes some SIMD magic.  

[oapi-codegen 2.6: Generate Go Boilerplate from OpenAPI 3 Specs](https://github.com/oapi-codegen/oapi-codegen/releases/tag/v2.6.0) — A tool and library for converting OpenAPI specs to Go code, both server and client-side. This release celebrates the project’s seventh anniversary and focuses largely on cleanups and tweaks to stay up to date. 

Various Contributors   

🎨 [Swatchify: Extract Dominant Colors from Images](https://james-see.github.io/swatchify/) — Available as a Go-based library, CLI, _or_ JavaScript library, Swatchify uses k-means clustering to get the dominant colors in an image. [GitHub repo](https://github.com/james-see/swatchify). 

James Campbell   

[Zen: A Minimalist HTTP Library for Go](https://www.unkey.com/blog/zen) — A `net/http` wrapper that suits a schema-first approach and allows precise control over middleware execution order. [GitHub repo.](https://github.com/unkeyed/unkey/tree/main/pkg/zen#readme) 

Andreas Thomas   

[betteralign 0.9: Make Your Programs Use Less Memory.. Maybe](https://github.com/dkorunic/betteralign) — Detects structs that _could_ use less memory if their fields were organized differently and rewrites them if you want. It’s a fork of Go’s [fieldalignment](https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/fieldalignment) tool but with numerous DX enhancements. 

Dinko Korunic   

- 🖼️ [govips 2.17](https://github.com/davidbyttow/govips/releases/tag/v2.17.0) – Fast libvips-powered image processing and resizing in Go. Now has PSD support, a gravity function, faster `image.Image` interop, and more.
- [eBPF 0.21](https://github.com/cilium/ebpf) – Pure Go loading, compilation, and debugging of eBPF programs.
- 🔒 [Tinyauth 5.0](https://github.com/steveiliop56/tinyauth) – Easy authentication middleware for Docker apps.
- [go-github 84.0](https://github.com/google/go-github/releases/tag/v84.0.0) – Client library for accessing GitHub's v3 REST API.
- 💬 [slack-go 0.19](https://github.com/slack-go/slack) – Widely used library for interacting with Slack's API.
- [Robotgo 1.0.1](https://github.com/go-vgo/robotgo) – Desktop mouse and keyboard automation library.
- [Gin 1.12](https://gin-gonic.com/) – Popular high-perf web framework for building APIs.
- [urfave/cli 3.7](https://github.com/urfave/cli) – Popular declarative CLI tooling package.
- [Circuit 4.1](https://github.com/cep21/circuit) – Hystrix-like circuit breaker implementation.
- ✉️ [go-premailer 1.32](https://github.com/vanng822/go-premailer) – Inlines CSS into HTML emails.  

📢 Elsewhere in the ecosystem 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/etduribv7qojuojgzdmh.jpg)](https://dev.to/mame/which-programming-language-is-best-for-claude-code-508a)  

- 🤖 A core member of the Ruby core team, Yusuke Endoh, [got Claude Code to implement a basic Git clone in thirteen languages](https://dev.to/mame/which-programming-language-is-best-for-claude-code-508a), including Go, to see how quickly, and cheaply, it would produce code in each language. Go led the way amongst typed languages.
- [Locutus](https://locutus.io/) is a project that brings together TypeScript ports of standard libraries from fifteen other programming languages, including Go. [The Go collection](https://locutus.io/golang/) is made up of 79 functions so far covering eight modules.
- If you're a [Hacker News](https://news.ycombinator.com/) reader, you might like [this project for 'skinning' HN](https://github.com/susam/hnskins#readme) for a nicer reading experience.
- [An interactive version](https://editor.p5js.org/isohedral/full/vJa5RiZWs) of the [famous xkcd comic](https://xkcd.com/2347/) about single-person dependencies, courtesy of [p5.js.](https://p5js.org/)         

Curated by Peter Cooper and [Glenn Goodrich](https://twitter.com/ruprict).
Go is a [trademark of Google](https://go.dev/brand).
The [Go gopher](https://go.dev/blog/gopher), whenever used, is an original creation by Renée French. 

[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
