Refactor: add a welsh hello prefix constant

This commit is contained in:
Oliver Davies 2022-01-27 00:12:35 +00:00
parent a92fffd81e
commit 7fe8bdc914

View file

@ -3,6 +3,7 @@ package main
import "fmt"
const englishHelloPrefix = "Hello, "
const welshHelloPrefix = "Helo, "
func Hello(name string, language string) string {
if name == "" {
@ -10,7 +11,7 @@ func Hello(name string, language string) string {
}
if language == "Welsh" {
return "Helo, " + name
return welshHelloPrefix + name
}
return englishHelloPrefix + name