init commit

This commit is contained in:
huker667 committed 2026-03-25 14:41:05 +03:00
commit 4ff821beed
8 files changed
+678

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
package helpers
import (
"fmt"
"strings"
"strconv"
)
func Ask(str string) bool {
var input string
fmt.Printf("-> %s (Y/n): ", str)
fmt.Scanln(&input)
input = strings.TrimSpace(input)
input = strings.ToLower(input)
if input != "y" && input != "" && input != "yes" {
return false
}
return true
}
func ToString(v interface{}) string {
switch val := v.(type) {
case int:
return strconv.Itoa(val)
case float64:
return strconv.FormatFloat(val, 'f', -1, 64)
case string:
return val
default:
return ""
}
}