learn-go-with-tests/hello/hello.go

18 lines
219 B
Go
Raw Normal View History

2023-09-29 10:07:31 -04:00
package main
import "fmt"
const englishHelloPrefix = "Hello, "
func Hello(name string) string {
2023-09-29 10:15:35 -04:00
if name == "" {
name = "World"
}
2023-09-29 10:07:31 -04:00
return englishHelloPrefix + name
}
func main() {
fmt.Println(Hello("world"))
}