MCPcopy
hub / github.com/Jrohy/trojan / Input

Function Input

util/string.go:125–133  ·  view source on GitHub ↗

Input 读取终端用户输入

(tip string, defaultValue string)

Source from the content-addressed store, hash-verified

123
124// Input 读取终端用户输入
125func Input(tip string, defaultValue string) string {
126 input := ""
127 fmt.Print(tip)
128 _, _ = fmt.Scanln(&input)
129 if input == "" && defaultValue != "" {
130 input = defaultValue
131 }
132 return input
133}
134
135// Red 红色
136func Red(str string) string {

Callers 8

ResetAdminPassFunction · 0.92
SetDomainFunction · 0.92
InstallTlsFunction · 0.92
InstallMysqlFunction · 0.92
ChangePortFunction · 0.92
AddUserFunction · 0.92
SetUserQuotaFunction · 0.92
SetupExpireFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected