refactor: rename utils

This commit is contained in:
Fu Diwei
2025-06-15 21:51:07 +08:00
parent e7ce12772a
commit 8149034bdc
84 changed files with 796 additions and 796 deletions

View File

@@ -1,4 +1,4 @@
package certutil
package cert
import (
"crypto/x509"

View File

@@ -1,4 +1,4 @@
package certutil
package cert
import (
"crypto/ecdsa"

View File

@@ -1,4 +1,4 @@
package certutil
package cert
import (
"encoding/pem"

View File

@@ -1,4 +1,4 @@
package certutil
package cert
import (
"crypto"

View File

@@ -1,4 +1,4 @@
package certutil
package cert
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package fileutil
package file
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package httputil
package http
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package httputil
package http
import (
"net"

View File

@@ -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
}
}

View File

@@ -1,4 +1,4 @@
package maputil
package maps
import (
mapstructure "github.com/go-viper/mapstructure/v2"

View File

@@ -1,4 +1,4 @@
package sliceutil
package slices
// 创建给定切片一部分的浅拷贝,其包含通过所提供函数实现的测试的所有元素。
//

View File

@@ -1,4 +1,4 @@
package typeutil
package types
import (
"reflect"

View File

@@ -1,4 +1,4 @@
package typeutil
package types
import (
"reflect"