mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-17 16:10:09 +01:00
commit
d038dca37c
1 changed files with 1 additions and 6 deletions
|
|
@ -4,7 +4,6 @@ import (
|
|||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
|
@ -20,11 +19,7 @@ func Prompt(question string, defaultValue ...string) string {
|
|||
fmt.Printf(question + ": ")
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
input, _ := reader.ReadString('\n')
|
||||
EOL := "\n"
|
||||
if runtime.GOOS == "windows" {
|
||||
EOL = "\r\n"
|
||||
}
|
||||
input = strings.Replace(input, EOL, "", -1)
|
||||
input = strings.TrimSpace(input)
|
||||
|
||||
if input != "" {
|
||||
answer = input
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue