First fancy HelloWorld
This commit is contained in:
parent
057db76a70
commit
36d35fe791
4 changed files with 30 additions and 0 deletions
3
go.mod
Normal file
3
go.mod
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module git.brueck.tools/jackhead/go-playground.git
|
||||
|
||||
go 1.24.1
|
||||
14
helloWorld/hello.go
Normal file
14
helloWorld/hello.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package helloworld
|
||||
|
||||
func Greeting(mood int) string {
|
||||
switch mood {
|
||||
case 0:
|
||||
return "Hello cruel world!"
|
||||
case 1:
|
||||
return "Hello crude world!"
|
||||
case 2:
|
||||
return "Hello cool world!"
|
||||
default:
|
||||
return "Aye mate!"
|
||||
}
|
||||
}
|
||||
BIN
main/main
Executable file
BIN
main/main
Executable file
Binary file not shown.
13
main/main.go
Normal file
13
main/main.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
helloworld "git.brueck.tools/jackhead/go-playground.git/helloWorld"
|
||||
)
|
||||
|
||||
func main() {
|
||||
for i := range 5 {
|
||||
fmt.Println(helloworld.Greeting(i))
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue