jub0bs

@jub0bs.com

infosec enthusiast • Go dev & trainer • contributor to the Go project • minimalist • chaotic good • trying to make sense of the Web • he/him Blog: https://jub0bs.com Free Go course: https://github.com/jub0bs/go-course-beginner Free 🇵🇸! Leave 🇱🇧 alone!

I love how the conjunction of #golang's modules system and build constraints lets you have your cake and eat it too! 🍰 You can let users of your library take advantage of the bleeding edge if they so wish without cutting off one of the currently supported Go toolchains.

Paradoxically (perhaps), as the Go compiler becomes better at eliminating bounds checks, attacker-reachable panics due to incorrect programmer assumptions about indices become easier to find. #golang

#golang quiz: What happens if you try to compile and run the following program? package main import ( "fmt" "math" ) func main() { fmt.Println(int(math.NaN())) } a. It prints 0. b. It prints -1. c. It panics. d. Compilation fails. e. Something else.

🚀 "spec: generic methods for Go" has been accepted! You will soon (1.27?) be able to declare (on concrete types only) methods that introduce type parameters, i.e. type parameters other than the ones (if any) that come from the method's receiver. github.com/golang/go/is... #golang

spec: generic methods for Go · Issue #77273 · golang/go

Proposal: Generic Methods for Go A change of view. Background For clarity, in the following we use the term concrete method (or just method when the context is clear) to describe a non-interface me...

github.com

For months (maybe years, even) now, I've been accumulating notes with a view to producing a performance-oriented Go training course. There's just so many techniques and tools to master! I'm hopeful for a release some time in 2026, though. 🤞 #golang

#golang quizz: why is the implementation of the following function naive/incorrect, and how would you fix it? 😉 // opposite returns the opposite of comparator function cmp. func opposite[T any](cmp func(T, T) int) func(T, T) int { return func(x, y T) int { return -cmp(x, y) } }