In Go, the intuitive way would be one loop with an if inside it. So it would be easy to spot this performance issue if you did it the ruby way with two loops.
https://go.dev/play/p/ixDKuosxPNp
I bet I wrote my for loop as quickly as you wrote your map. The character count isn't that much higher.