Refactor: add a welsh constant

This commit is contained in:
Oliver Davies 2022-01-27 00:16:56 +00:00
parent 7fe8bdc914
commit 81f9f9874d

View file

@ -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
}