Initial commit: Go project with greet function and CLI
This commit is contained in:
10
pkg/greet/greet.go
Normal file
10
pkg/greet/greet.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package greet
|
||||
|
||||
// Greet returns a greeting message for the given name.
|
||||
// If name is empty, it defaults to "world".
|
||||
func Greet(name string) string {
|
||||
if name == "" {
|
||||
return "Hello world!"
|
||||
}
|
||||
return "Hello " + name + "!"
|
||||
}
|
||||
Reference in New Issue
Block a user