mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-14 21:23:47 +08:00
发布v2.13.1版本,更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
@@ -58,19 +58,6 @@ func GetMapKeys[K comparable](m map[K]any) []K {
|
||||
return keys
|
||||
}
|
||||
|
||||
// UniqueSlice 切片去重
|
||||
func UniqueSlice[K comparable](languages []K) []K {
|
||||
result := make([]K, 0, len(languages))
|
||||
temp := map[K]struct{}{}
|
||||
for _, item := range languages {
|
||||
if _, ok := temp[item]; !ok {
|
||||
temp[item] = struct{}{}
|
||||
result = append(result, item)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// CamelCaseToUnderline 驼峰单词转下划线单词
|
||||
func CamelCaseToUnderline(s string) string {
|
||||
var output []rune
|
||||
|
||||
Reference in New Issue
Block a user