Files

18 lines
445 B
Go
Raw Permalink Normal View History

// Package utils 提供通用工具函数
// 包含字符串处理、格式化等常用功能
package utils
import "strings"
// FormatKey 格式化键值
// 移除空格,转换为小写,确保键值的唯一性和一致性
// 参数:
// - key: 原始键值
2026-08-10 11:42:45 +08:00
//
// 返回:
// - 格式化后的键值
func FormatKey(key string) string {
// 移除所有空格并转换为小写
return strings.ToLower(strings.ReplaceAll(key, " ", ""))
}