refactor: code review

This commit is contained in:
meilin.huang
2023-10-20 21:31:46 +08:00
parent 45d2449221
commit 10f6b03fb5
15 changed files with 270 additions and 209 deletions

View File

@@ -1,6 +1,6 @@
package collx
import "mayfly-go/pkg/utils/stringx"
import "mayfly-go/pkg/utils/anyx"
// M is a shortcut for map[string]any
type M map[string]any
@@ -12,7 +12,7 @@ func Kvs(elements ...any) M {
myMap := make(map[string]any)
for i := 0; i < len(elements); i += 2 {
key := stringx.AnyToStr(elements[i])
key := anyx.ToString(elements[i])
if i+1 < len(elements) {
value := elements[i+1]
myMap[key] = value