refactor: rename utils
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package certutil
|
||||
package cert
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package certutil
|
||||
package cert
|
||||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package certutil
|
||||
package cert
|
||||
|
||||
import (
|
||||
"encoding/pem"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package certutil
|
||||
package cert
|
||||
|
||||
import (
|
||||
"crypto"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package certutil
|
||||
package cert
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package fileutil
|
||||
package file
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package httputil
|
||||
package http
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package httputil
|
||||
package http
|
||||
|
||||
import (
|
||||
"net"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package maputil
|
||||
package maps
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
@@ -103,7 +103,7 @@ func GetOrDefaultInt32(dict map[string]any, key string, defaultValue int32) int3
|
||||
}
|
||||
|
||||
if result != 0 {
|
||||
return int32(result)
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,13 +166,13 @@ func GetOrDefaultInt64(dict map[string]any, key string, defaultValue int64) int6
|
||||
result = int64(v)
|
||||
case string:
|
||||
// 兼容字符串类型的值
|
||||
if t, err := strconv.ParseInt(v, 10, 32); err == nil {
|
||||
if t, err := strconv.ParseInt(v, 10, 64); err == nil {
|
||||
result = t
|
||||
}
|
||||
}
|
||||
|
||||
if result != 0 {
|
||||
return int64(result)
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package maputil
|
||||
package maps
|
||||
|
||||
import (
|
||||
mapstructure "github.com/go-viper/mapstructure/v2"
|
||||
@@ -1,4 +1,4 @@
|
||||
package sliceutil
|
||||
package slices
|
||||
|
||||
// 创建给定切片一部分的浅拷贝,其包含通过所提供函数实现的测试的所有元素。
|
||||
//
|
||||
@@ -1,4 +1,4 @@
|
||||
package typeutil
|
||||
package types
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
@@ -1,4 +1,4 @@
|
||||
package typeutil
|
||||
package types
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
Reference in New Issue
Block a user