missing error arg

This commit is contained in:
Andrew Hurley 2022-11-12 15:02:37 +08:00
parent 32b032ddb6
commit ee2e28c11d
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ import "fmt"
import "errors" import "errors"
// Hello returns a greeting for the named person. // Hello returns a greeting for the named person.
func Hello(name string) string { func Hello(name string) (string,error) {
// If no name was given, return an error with a message. // If no name was given, return an error with a message.
if name == "" { if name == "" {
return "", errors.New("empty name") return "", errors.New("empty name")