package main
import (
"fmt"
"encoding/json"
)
func main() {
bvalue := []byte("123")
svalue:=string(bvalue)
fmt.Println("[]byte: " + string(bvalue))
fmt.Println("svalue: ",svalue)
m := map[string][]byte{
"foo": bvalue,
}
marshal, _ := json.Marshal(m)
fmt.Println(string(marshal))
m2 := make(map[string]interface{})
m2["as"]=bvalue
marshal2, _ := json.Marshal(m2)
fmt.Println(string(marshal2))
}
01-20
05-01
05-01
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交