interface转int

x :=interface(5)
y := x.(int)

转string

strconv.Itoa()

转int

strconv.Atoi

interface转为json

sss := "{"exp":1690888016,"group_id":1129,"id":140,"name":"张转码"}"
var pu interface
err :=json.Unmarshal([]byte(sss), &pu)
print(pu)
#子级对象转换
mmap := pu.User.(map[string]interface)
fmt.Println(mmap)
fmt.Println(mmap["data"], mmap["exp"], mmap["type"])