// Package greet makes the greetings for both programs in this module. It is // under internal/, so only code inside this module can import it. package greet import "strings" // Hello returns a greeting for name. func Hello(name string) string { return "Hello, " + clean(name) + "!" } // Goodbye returns a farewell for name. func Goodbye(name string) string { return "Goodbye, " + clean(name) + "." } // clean trims the name, and uses "friend" when there is no name. func clean(name string) string { name = strings.TrimSpace(name) if name == "" { return "friend" } return name }