And to be clear, the wrapper itself is not the monad, it is the implementation of bind over the wrapper that is the monad. So, Go doesn't actually implement a monad, it just implements the wrapper. All it needs to do is implement bind and then you would get more elegant code.
And it just occurred to me (I'm getting pretty tired) that the reason Go doesn't make it simpler is because the creators of Go refuse to implement generics for the language. Which is unfortunate, since if you had generics you would be able to bypass some of this tedium in coding.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
And to be clear, the wrapper itself is not the monad, it is the implementation of bind over the wrapper that is the monad. So, Go doesn't actually implement a monad, it just implements the wrapper. All it needs to do is implement bind and then you would get more elegant code.
And it just occurred to me (I'm getting pretty tired) that the reason Go doesn't make it simpler is because the creators of Go refuse to implement generics for the language. Which is unfortunate, since if you had generics you would be able to bypass some of this tedium in coding.