feat: import services and standardize Go 1.26.5
This commit is contained in:
16
apps/base/cms/internal/utils/string.go
Normal file
16
apps/base/cms/internal/utils/string.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// Package utils 提供通用工具函数
|
||||
// 包含字符串处理、格式化等常用功能
|
||||
package utils
|
||||
|
||||
import "strings"
|
||||
|
||||
// FormatKey 格式化键值
|
||||
// 移除空格,转换为小写,确保键值的唯一性和一致性
|
||||
// 参数:
|
||||
// - key: 原始键值
|
||||
// 返回:
|
||||
// - 格式化后的键值
|
||||
func FormatKey(key string) string {
|
||||
// 移除所有空格并转换为小写
|
||||
return strings.ToLower(strings.ReplaceAll(key, " ", ""))
|
||||
}
|
||||
Reference in New Issue
Block a user