debian-btw

debian-btw

https://git.tonybtw.com/debian-btw.git git://git.tonybtw.com/debian-btw.git
554 bytes raw
1
package main
2
3
import (
4
	"fmt"
5
	"runtime"
6
	"strings"
7
)
8
9
func hello_world(s string) {
10
	pc, _, _, _ := runtime.Caller(0) 
11
	fn := runtime.FuncForPC(pc)
12
	funcName := strings.Split(fn.Name(), ".")[1]
13
14
	words := strings.Split(funcName, "_")
15
	for i := range words {
16
		words[i] = strings.Title(words[i])
17
	}
18
19
	message := strings.Join(words, ", ") + "!!"
20
	funcs := map[string]func(...interface{})(int, error) {
21
		"println": fmt.Println,
22
		"print": fmt.Print,
23
	}
24
	MrBeast := funcs[strings.ToLower(s)+"ln"]
25
	MrBeast(message)
26
}
27
28
func main() {
29
	hello_world("print")
30
}