You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 2, 2023. It is now read-only.
package main
import (
"fmt"
prompt "github.com/segmentio/go-prompt"
)
funcmain() {
str:=prompt.String("Enter some string")
fmt.Println("Read:", str)
}
running it shows that it breaks at the first space, rather than at the newline:
vagrant@vagrant-ubuntu-trusty-64:/opt/secrets$ go run test.go
Enter some string: ljadjf lasdjflaksjflasdjfl asjfladjsfl
Read: ljadjf
vagrant@vagrant-ubuntu-trusty-64:/opt/secrets$ asdjflaksjflasdjfl asjfladjsfl
asdjflaksjflasdjfl: command not found
I think the expected behavior is that it should function like readline and terminate after a newline, not after a space is inputted.
Test code:
running it shows that it breaks at the first space, rather than at the newline:
vagrant@vagrant-ubuntu-trusty-64:/opt/secrets$ go run test.go Enter some string: ljadjf lasdjflaksjflasdjfl asjfladjsfl Read: ljadjf vagrant@vagrant-ubuntu-trusty-64:/opt/secrets$ asdjflaksjflasdjfl asjfladjsfl asdjflaksjflasdjfl: command not foundI think the expected behavior is that it should function like readline and terminate after a newline, not after a space is inputted.