This commit is contained in:
2025-06-30 16:44:06 +08:00
parent 4186cd0caf
commit c8a81d0f49
840 changed files with 1389 additions and 403165 deletions

View File

@@ -1,7 +1,6 @@
package convertor
import (
"net/url"
"strconv"
"time"
)
@@ -23,13 +22,8 @@ func Bool(value string, defaultValue bool) bool {
return b
}
func QueryInt[T int | int16 | int32 | int64](vars url.Values, key string, defaultValue T) T {
v := vars.Get(key)
if len(v) == 0 {
return defaultValue
}
i, err := strconv.Atoi(v)
func QueryInt[T int | int16 | int32 | int64](value string, defaultValue T) T {
i, err := strconv.Atoi(value)
if err != nil {
return defaultValue
}