MCPcopy Create free account
hub / github.com/HashLoad/boss / getParamOrDef

Function getParamOrDef

cmd/init.go:65–79  ·  view source on GitHub ↗
(msg string, def string)

Source from the content-addressed store, hash-verified

63}
64
65func getParamOrDef(msg string, def string) string {
66 fmt.Print(msg + ": ")
67 rr := bufio.NewReader(os.Stdin)
68 if res, e := rr.ReadString('\n'); e == nil && res != "\n" {
69 res = strings.ReplaceAll(res, "\t", "")
70 res = strings.ReplaceAll(res, "\n", "")
71 res = strings.ReplaceAll(res, "\r", "")
72 if res == "" {
73 return def
74 } else {
75 return res
76 }
77 }
78 return def
79}
80
81func printHead() {
82 println(`

Callers 2

doInitializationFunction · 0.85
loginFunction · 0.85

Calls 1

PrintMethod · 0.80

Tested by

no test coverage detected