Refactor: add a welsh constant
This commit is contained in:
parent
7fe8bdc914
commit
81f9f9874d
3
hello.go
3
hello.go
|
@ -3,6 +3,7 @@ package main
|
|||
import "fmt"
|
||||
|
||||
const englishHelloPrefix = "Hello, "
|
||||
const welsh = "Welsh"
|
||||
const welshHelloPrefix = "Helo, "
|
||||
|
||||
func Hello(name string, language string) string {
|
||||
|
@ -10,7 +11,7 @@ func Hello(name string, language string) string {
|
|||
name = "World"
|
||||
}
|
||||
|
||||
if language == "Welsh" {
|
||||
if language == welsh {
|
||||
return welshHelloPrefix + name
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue