mirror of
https://github.com/beego/bee.git
synced 2024-11-22 15:10:54 +00:00
refactor: optimized code
This commit is contained in:
parent
de6e732441
commit
da530d986c
@ -153,8 +153,10 @@ func AskForConfirmation() bool {
|
||||
if err != nil {
|
||||
beeLogger.Log.Fatalf("%s", err)
|
||||
}
|
||||
okayResponses := []string{"y", "Y", "yes", "Yes", "YES"}
|
||||
nokayResponses := []string{"n", "N", "no", "No", "NO"}
|
||||
response = strings.ToLower(strings.TrimSpace(response))
|
||||
|
||||
okayResponses := []string{"y", "yes"}
|
||||
nokayResponses := []string{"n", "no"}
|
||||
if containsString(okayResponses, response) {
|
||||
return true
|
||||
} else if containsString(nokayResponses, response) {
|
||||
|
Loading…
Reference in New Issue
Block a user