News for hackers. Stuff that matters.
Re:Go 1.18 by Beltalowda on Wednesday March 16, 2022 @10:33AM (#30699319)
Doesn't exactly win any awards for elegance, but:

  err := h(map[bool]func(T){true: f, false: g}[cond(x)](x))
You're probably not going to want to use this though, although I've used the map[bool]T trick in some simpler examples.

There are no comments on this comment yet.