pull down to refresh
59 sats \ 0 replies \ @l0k18 5 May 2023 \ parent \ on: We need to build more services software on lightning bitcoin
Go has interfaces. There's no need to complicate a language with more than one effective way to do things. You can mimic much of the behaviour of variants and generics with interfaces. And the interfaces available in Go since 1.18 are a pretty slim set and don't include any structured types. You can do signed/unsigned/float and you can do arrays (predefined size) but that's it, at least if I have grasped it correctly.
Easy way to remember if Go has a feature: is there a simpler way to do it? Ok, no. No map/reduce/filter or complex iterators, no generics, no objects, the slice and map are naked and barely cloaked pointer types that make for some racy fun with goroutines.