This is quite interesting, since the article states absolutely nothing about Go language.
Since, it's the most common or even fairly standard technique in the language:
func Hello(name string) (string, error) {
// If no name was given, return an error with a message.
if name == "" {
return "", errors.New("empty name")
}
// ...
}
all 4 comments