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