---
title: "Why Go slices throw up surprises"
publication: "Go Weekly"
issue: 534
published_at: "2024-12-03"
canonical_url: "https://golangweekly.com/issues/534"
---

Plus a look forward to Go 1.24, and a Go-powered alternative to Google Analytics. |        

#​534 — December 3, 2024 

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

Together with [![Google\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_800,h_271/e_make_transparent/co_white,e_outline:8/u7hgy97824jj4gjk5gok.png)](https://shortclick.link/sn02rq)   

Go Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/ivgclzznbsdjsvzq3lcy.jpg)](https://tip.golang.org/doc/go1.24)  

[The Draft Go 1.24 Release Notes](https://tip.golang.org/doc/go1.24) — Last week, we enjoyed Daniel Martí’s [slidedeck on what’s coming in Go 1.24](https://docs.google.com/presentation/d/1jvc0RzrshOOjkeEnsyea2jwjs_zVOcyETG558pqPOK0/edit#slide=id.g550f852d27_228_0) early in 2025 – we’ve now noticed the draft release notes are coming along well and give a thorough bulletpoint-heavy roundup of what we can expect. 

Go Team   

[Weak Pointers in Go: Why They Matter Now](https://victoriametrics.com/blog/go-weak-pointer/) — A look at a feature expected to land properly in Go 1.24 (via the [weak](https://pkg.go.dev/internal/weak) package). Weak pointers are a low-level primitive that enable the creation of certain memory-efficient structures and Phuong explains the basics of how they work. 

Phuong Le   [![\](https://res.cloudinary.com/cpress/image/upload/c_limit,w_480,h_480,q_auto/copm/1f2bd88d.png)](https://shortclick.link/sn02rq) 

[We Put the Go in Google Gemini](https://shortclick.link/sn02rq) — Google Gemini 1.5 Flash 8B for Go has a 1M token context window, capable of processing more than 30,000 lines of code via screencast or logfiles in seconds for a fraction of the cost. Build today using the Google API Quickstart in Go. 

Google Gemini sponsor   

[Why Go Slices Still Surprise Me](https://build-your-own.org/blog/20241125_go_slice_surprise/) — Slices are a common source of confusion and bugs, and this could be due to the merging of two different use cases into one concept. Sometimes, it’s a ['fat pointer'](https://nullprogram.com/blog/2019/06/30/); sometimes, it’s a dynamic array. Confusing the two is where the pain starts. 

James Smith   

[Go-App: A Package to Build Progressive Web Apps with Go and WebAssembly](https://go-app.dev/) — An intriguing way to build webapps _entirely_ in Go (including the frontend UI). [astextract](https://astextract.lu4p.xyz/) is a Go-source-to-AST app that demonstrates the concept. [GitHub repo.](https://github.com/maxence-charriere/go-app) 

Maxence Charriere   

[Diving into eBPF: Building a Process Tracer from Scratch](https://blog.smidt.dev/posts/0003/) — This is certainly a deep dive down a technical Linux rabbit hole, but this sort of post is gold for when you need to plumb such depths. 

The Smidt   

**IN BRIEF:** 

- 🎤 [Lea Anthony of the Wails project went on _go podcast()_](https://gopodcast.dev/episodes/048-lea-antony-on-wails) to discuss the art of building desktop apps using web tech. [Wails](https://wails.io/) is essentially a lighter weight Go-flavored take on Electron.
- [GoReleaser](https://goreleaser.com/) is a popular tool for releasing Go binaries for numerous platforms at once, but it looks like [both Rust](https://goreleaser.com/customization/rust-builds/) and [Zig](https://goreleaser.com/customization/zig-builds/) support are on the way in the forthcoming v2.5.
- 🎄 If you fancy a daily programming challenge in the run up to Christmas, don't forget that the [Advent of Code 2024](https://adventofcode.com/) has begun.   

[Running a Simple Go Web Service on NixOS](https://mtlynch.io/notes/simple-go-web-service-nixos/) — _“I only just started using NixOS modules to manage my personal services, but I’m excited at how well they work for so little investment.”_ 

Michael Lynch   

📄 [Mastering Go Debugging from Emacs](https://blog.dornea.nu/2024/11/28/mastering-golang-debugging-in-emacs/) – A lot of detail for fans of the long standing operating system _editor._ Victor Dorneanu 

📄 [Lessons Learned Adding OpenTelemetry to a (Cobra) Command-Line Go Tool](https://www.jvt.me/posts/2024/11/17/cobra-otel-lessons/) Jamie Tanna 

📄 [The Smallest Thing in Go](https://bitfieldconsulting.com/posts/iota) – A quick look at Go’s [`iota` identifier.](https://go.dev/wiki/Iota) John Arundel 

📄 [Good Union Types in Go Would Probably Need Types Without a Zero Value](https://utcc.utoronto.ca/~cks/space/blog/programming/GoUnionTypesAndZeroValues) Chris Siebenmann 

📄 [Building a Distributed Log using S3 (in Under 150 Lines of Go)](https://avi.im/blag/2024/s3-log/) Avinash Sajjanshetty  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/nvdxjddrhpmqs3o1dtea.jpg)](https://www.vinceanalytics.com/)  

[Vince: Go-Powered, Self Hosted Web Analytics System](https://www.vinceanalytics.com/) — Web stats, link tracking, and more, for unlimited sites and in a single binary. It can even act as a drop-in replacement for [Plausible](https://plausible.io/) and use the same scripts. There’s [an example](https://demo.vinceanalytics.com/share/vinceanalytics.com/v1/share/vinceanalytics.com?auth=Ls9tV4pzqOn7BJ7-&demo=true) of a live dashboard. [GitHub repo.](https://github.com/vinceanalytics/vince) 

Geofrey Ernest   

🔊 [go-taglib: Read/Write Audio Metadata Tags](https://github.com/sentriz/go-taglib) — Read and write metadata tags for audio files (like MP3, FLAC, and OGG) including support for multi-valued tags. Portable with no external runtime dependencies (it embeds a WASM version of the C++-based [taglib](https://github.com/taglib/taglib)). _(Note: LGPL licensed.)_ 

Senan Kelly   

[WorkOS: Sell to Enterprises with a Few Lines of Code](https://workos.com/?utm_source=cpgo&utm_medium=newsletter&utm_campaign=q42024) — The modern identity platform for B2B SaaS, offering flexible, easy-to-use APIs to integrate SSO, SCIM, and FGA in minutes instead of months. 

WorkOS sponsor   

[Rill 0.6: A Composable Concurrency Toolkit for Go](https://github.com/destel/rill) — A collection of functions for streaming, parallel processing, and pipeline construction – all aiming to make it _“easier to build concurrent programs from simple, reusable parts.”_ 

Viktor Nikolaiev   

🪨 [Pebble: RocksDB/LevelDB Inspired Key-Value Database in Go](https://github.com/cockroachdb/pebble) — A key-value store focused on performance that uses RockDB’s file format but adds a few extra features that CockroachDB needs. It’s used at scale within CockroachDB and is considered stable and production ready. 

CockroachDB   

🕸️ [Katana: A Web Crawling and Spidering Framework](https://github.com/projectdiscovery/katana) — A flexible Go-powered Web crawling tool (which can also be used as a library from Go) that can work in both headless and non-headless modes and has lots of customizable features. 

ProjectDiscovery   

[shortuuid 4.2: Generate Concise, Unambiguous and URL-Safe Unique IDs](https://github.com/lithammer/shortuuid) — These aren’t standardized UUIDs, but for when you want short, non-sequential user-facing IDs (e.g. `KwSysDpxcBU9FNhGkn2dCf`). 

Peter Lithammer   

[Quill 0.5: Sign Mac Binaries from Any Platform](https://github.com/anchore/quill) — Give it a signing private key and certificate from Apple, Quill does the rest to sign and notarize macOS binaries. 

Anchore, Inc.      

📰 Classifieds   

How Authorization fits into the Architecture of Secure AI RAG stacks? [Watch AuthZed CEO Jacob Moshenko addressing this topic, and more with The Cube](https://www.youtube.com/watch?v=9Giynn1odZo). 

--- 

🪝 [Hookdeck](https://hookdeck.com/?ref=goweekly-534): A serverless queue to reliably send, receive, transform, filter, and route events across your event-driven apps.      

- [BadgerDB 4.5](https://github.com/dgraph-io/badger) – Embeddable, fast pure-Go key-value DB.
- [SFTPGo 2.6.4](https://github.com/drakkan/sftpgo) – Full featured SFTP server. ([Docs.](https://sftpgo.github.io/latest/))
- [Go OpenAI 1.36](https://github.com/sashabaranov/go-openai) – An OpenAI API wrapper library.
- [go-github v67.0](https://github.com/google/go-github/releases/tag/v67.0.0) – GitHub v3 API client library.
- [Goyave 5.5](https://github.com/go-goyave/goyave/releases/tag/v5.5.0) – Enterprise REST API framework.         

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
