fix for windows \r\n

This commit is contained in:
olebeck 2022-02-12 22:51:49 +00:00 committed by GitHub
parent 3cf2e2bea6
commit 1ab39844f8
1 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,8 @@ func main() {
fmt.Printf("Enter Server: ")
reader := bufio.NewReader(os.Stdin)
target, _ = reader.ReadString('\n')
target = target[:len(target)-1]
target = strings.Replace(target, "\n", "", -1)
target = strings.Replace(target, "\r", "", -1)
}
if len(strings.Split(target, ":")) == 1 { // add default port if not set
target += ":19132"