MarcGyver π retweeted
whoa, whoa, whoa!
Why did no one tell me about the debug tooling for flexbox in Chrome?!
Yeah, finally Go 1.22 with the new routing pattern support is here.
tip.golang.org/doc/go1.22#enβ¦
Don't forget to change the Go version in your existing go.mod to 1.22 otherwise it will stick to the old Go version.
46
Are you tired of breaking your fingers writing shell scripts because the syntax is so special?
Maybe Go script is something for you. You can use it to write a lot of things in Go that you used to write as a shell script.
github.com/bitfield/script
When working with CGO the chance to produce memory leaks by accident is very high. A simple way besides pprof to locate memory leaks is the "Instruments" App that is shipped with Xcode.
As you can see below, I have a memory leak: --> π§΅
1
75
Hey SQLiters, what are your most used PRAGMAs?
Mine are:
- PRAGMA synchronous=1; (to make sure, changes are synced to the underlying FS on the most critical moments)
- PRAGMA journal_mode = wal2; (enable the new write ahead log)
sqlite.org/pragma.html#toc
16
As a quick refresher: do you know the difference between length and capacity of slices?
Here's a great read on that topic: 100go.co/20-slice/
36
Remove specific elements from a slice with slices.DeleteFunc:
DeleteFunc takes the slice and a func that determines wether the element should be deleted or not.
In our example, we want to remove all sweets from the slice that does not begin with a capital C.
1
15
Who uses the new slices and maps packages with a lot of helper functions introduced in Go 1.21?
Let's play with some examples π§΅
pkg.go.dev/slices
pkg.go.dev/maps
tip.golang.org/doc/go1.21#slβ¦
1
1
22
What was the weirdest bug you've ever encountered?
Mine was a program, that randomly crashed when I was sitting on the couch in the living room, but ran fine in the office.
It turns out that a malfunctioning power supply in my living room produced interfering voltage spikes.
16
Can the EU please also free iOS development from X Code. Every time I use X Code I immediately feel too dumb to use my computer.
I know, you can hack VS Code to develop iOS apps, but this is also a pain. Dear EU, may I have an official VS Code extension from Apple, please? Thanks
48
If there were a country called "Land of Bubblesort" @ThePrimeagen would be its president. Awesome, free course about algorithms you definitely need (at least to get a job). Also, they are very well explained, so well that even your mom would understand it.
frontendmasters.com/courses/β¦
Today I stumbled upon fmt.Sprintf(":" + port) and was wondering, why this is so common?
Searching Github for this string reveals a lot of repos using this pattern.
github.com/search?q=fmt.Spriβ¦
Let's benchmark this and discuss alternatives π§΅
1
26
The winner, in this simple case, is of course string concatenation. However, it is not always the best option and does not make sense for larger strings and/or many concatenations. However, for this simple example, it is the fastest method and does not require memory allocation.
1
14
But why is fmt.Sprintf(":" + port) used so often? It is even used in Google's exposure notification server: github.com/google/exposure-nβ¦
Is it more readable? Is it idiomatic? Maybe someone with a background in profiling can enlighten me?
cc @felixge
1
17












