mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +08:00
23 lines
402 B
Go
23 lines
402 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"reflect"
|
|
"gitee.com/johng/gf/g/database/gdb"
|
|
)
|
|
|
|
func main() {
|
|
var value interface{}
|
|
value = gdb.Map{"a":1}
|
|
|
|
refValue := reflect.ValueOf(value)
|
|
|
|
if refValue.Kind() == reflect.Map {
|
|
keys := refValue.MapKeys()
|
|
for _, k := range keys {
|
|
fmt.Println(k, refValue.MapIndex(k).Interface())
|
|
}
|
|
}
|
|
|
|
}
|