package greetings import ( "fmt" "errors" ) func Greetings(name string) (string, error) { if (name==""){ return "", errors.New("Nimi puudub") } message:=fmt.Sprintf("Hello, %v", name) return message, nil } func MultipleGreetings(names []string) (map[string]string, error){ messages:=make(map[string]string) for _, name:= range names{ message, err:=Greetings(name) if err!=nil{ return nil, err } messages[name]=message } return messages, nil }