Refactor to use a constant
This commit is contained in:
parent
c715ac45e7
commit
a857ef5957
1 changed files with 3 additions and 1 deletions
4
hello.go
4
hello.go
|
@ -2,8 +2,10 @@ package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
const englishHelloPrefix = "Hello, "
|
||||||
|
|
||||||
func Hello(name string) string {
|
func Hello(name string) string {
|
||||||
return "Hello, " + name
|
return englishHelloPrefix + name
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
Reference in a new issue