Selaa lähdekoodia

优化 Windows 系统下按键退出代码 (#236)

mikuru996 3 vuotta sitten
vanhempi
sitoutus
ce15d4741a
1 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  1. 1 2
      main.go

+ 1 - 2
main.go

@@ -133,8 +133,7 @@ func endPrint() {
 	}
 	}
 	if runtime.GOOS == "windows" { // 如果是 Windows 系统,则需要按下 回车键 或 Ctrl+C 退出(避免通过双击运行时,测速完毕后直接关闭)
 	if runtime.GOOS == "windows" { // 如果是 Windows 系统,则需要按下 回车键 或 Ctrl+C 退出(避免通过双击运行时,测速完毕后直接关闭)
 		fmt.Printf("按下 回车键 或 Ctrl+C 退出。")
 		fmt.Printf("按下 回车键 或 Ctrl+C 退出。")
-		var pause int
-		fmt.Scanln(&pause)
+		fmt.Scanln()
 	}
 	}
 }
 }