mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
chore(portainer): clean up the code EE-5188 (#8660)
This commit is contained in:
parent
621a01ba3b
commit
15cbdb8af9
23 changed files with 111 additions and 65 deletions
|
@ -12,13 +12,14 @@ func Confirm(message string) (bool, error) {
|
|||
fmt.Printf("%s [y/N]", message)
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
|
||||
answer, err := reader.ReadString('\n')
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
answer = strings.Replace(answer, "\n", "", -1)
|
||||
|
||||
answer = strings.ReplaceAll(answer, "\n", "")
|
||||
answer = strings.ToLower(answer)
|
||||
|
||||
return answer == "y" || answer == "yes", nil
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue