Refactor: add a prefix variable
This commit is contained in:
parent
81f9f9874d
commit
26706e014d
1 changed files with 4 additions and 2 deletions
6
hello.go
6
hello.go
|
@ -11,11 +11,13 @@ func Hello(name string, language string) string {
|
|||
name = "World"
|
||||
}
|
||||
|
||||
prefix := englishHelloPrefix
|
||||
|
||||
if language == welsh {
|
||||
return welshHelloPrefix + name
|
||||
prefix = welshHelloPrefix
|
||||
}
|
||||
|
||||
return englishHelloPrefix + name
|
||||
return prefix + name
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
|
Reference in a new issue