Refactor: add a welsh hello prefix constant
This commit is contained in:
parent
a92fffd81e
commit
7fe8bdc914
3
hello.go
3
hello.go
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue