Read whole line instead of first space-delimited field
This commit is contained in:
parent
aad3ba9a57
commit
c474d3f8bf
|
@ -1,7 +1,9 @@
|
|||
package cli
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -9,7 +11,9 @@ func GetStringResponse(prompt string) string {
|
|||
fmt.Print(prompt + " ")
|
||||
|
||||
var response string
|
||||
fmt.Scan(&response)
|
||||
scanner := bufio.NewScanner(os.Stdin)
|
||||
scanner.Scan()
|
||||
response = scanner.Text()
|
||||
|
||||
return response
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue