2023-01-18 15:35:07 +02:00
|
|
|
package util
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2023-01-19 01:26:50 +02:00
|
|
|
// func InputTerminal(name string) string {
|
2023-01-18 15:35:07 +02:00
|
|
|
|
2023-01-19 01:26:50 +02:00
|
|
|
// fmt.Print(name + ": ")
|
|
|
|
// reader := bufio.NewReader(os.Stdin)
|
|
|
|
// ret, _ := reader.ReadString('\n')
|
|
|
|
// splitedSlice := strings.Split(ret, " ")
|
|
|
|
|
|
|
|
// if len(splitedSlice) == 1 {
|
|
|
|
// splSlice2 := strings.Split(splitedSlice[0], "\n")
|
|
|
|
// ret = splSlice2[0]
|
|
|
|
// } else {
|
|
|
|
// ret = splitedSlice[0]
|
|
|
|
// }
|
2023-01-18 15:35:07 +02:00
|
|
|
|
2023-01-19 01:26:50 +02:00
|
|
|
// retB := []byte(ret)
|
|
|
|
// fmt.Print(fmt.Sprintf("%s", retB[len(retB):]))
|
|
|
|
// if fmt.Sprintf("%s", retB[len(retB):]) == "[13]" {
|
|
|
|
// ret = fmt.Sprintf("%s", retB[:len(retB)-1])
|
|
|
|
// }
|
|
|
|
// fmt.Printf("%d\n", []byte(ret))
|
|
|
|
// return ret
|
|
|
|
// }
|
2023-01-18 15:35:07 +02:00
|
|
|
|
2023-01-19 01:26:50 +02:00
|
|
|
func InputTerminal(name string) string {
|
|
|
|
var ret string
|
|
|
|
fmt.Print(name + ": ")
|
|
|
|
fmt.Scanln(&ret)
|
2023-01-18 15:35:07 +02:00
|
|
|
return ret
|
|
|
|
}
|