this post was submitted on 29 Dec 2025
9 points (90.9% liked)

Golang

2599 readers
18 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] firelizzard@programming.dev 1 points 4 hours ago (1 children)

The core bug was that they were reading from a map without checking if the map entry existed. Given a non-nil var m map[K]V, m[key] always succeeds (never panics). If the given entry doesn’t exist, it returns the zero value for the type, i.e. var v V. If V is a pointer type, accessing a field or method will panic (because the zero value is nil). If V is a struct or other value type, it can be used normally. That bug is on them. Any Go developer who isn’t a novice should know how maps and value types behave.

[–] bookmeat@lemmynsfw.com 1 points 2 hours ago* (last edited 2 hours ago)

They also didn't use adequate guardrails to validate data.