Created
November 2, 2023 14:58
-
-
Save micahwalter/a7d77d1f5aca03b5738787c1f64ecb78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func stringPrompt(label string) string { | |
var s string | |
r := bufio.NewReader(os.Stdin) | |
for { | |
fmt.Fprint(os.Stderr, label+" ") | |
s, _ = r.ReadString('\n') | |
if s != "" { | |
break | |
} | |
} | |
return s | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment