golang 获取map的keys
package main import "fmt"
import "reflect" func main() {
abc := map[string]int{
"a": ,
"b": ,
"c": ,
} keys := reflect.ValueOf(abc).MapKeys() fmt.Println(keys) // [a b c]
}
2022-02-17 19:44:58
golang 获取map的keys
package main import "fmt"
import "reflect" func main() {
abc := map[string]int{
"a": ,
"b": ,
"c": ,
} keys := reflect.ValueOf(abc).MapKeys() fmt.Println(keys) // [a b c]
}