The advantage of this over textual documentation (which often diverges from reality) is it is checked to be syntactically correct by the compiler and checked that it actually does what it says it does by running it as a test.
Golang is a pretty awesome language TBH. The more I use it, the more I like it. So much of it just makes sense. You can defiantly see the lessons the language authors learned from the past and applied forward.
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.
This is one of the really nice things about Go.
It has built in support for examples in the testing framework. blog.golang.org/examples
So you can put stuff like this in your code
And they will automatically appear in the documentation.
Example
The advantage of this over textual documentation (which often diverges from reality) is it is checked to be syntactically correct by the compiler and checked that it actually does what it says it does by running it as a test.
that is pretty awesome :)
Golang is a pretty awesome language TBH. The more I use it, the more I like it. So much of it just
makes sense
. You can defiantly see the lessons the language authors learned from the past and applied forward.