你好我正在使用 golang 包“github.com/northwesternmutual/grammes”并且想要获取字段而不仅仅是来自响应客户端的值所以我可以将它解码为 jsondata, err := client.ExecuteQuery(g.V().Has("person", "name", "aksan").Values())if err != nil { log.Fatalf("Querying error: %s", err.Error())}var responseStruct map[string]interface{}err = json.Unmarshal(data[0], &responseStruct)if err != nil { log.Fatalf("unmarshal error: %s", err.Error())}// Log out the response.PrettyPrint(responseStruct["@value"], "result")回应是[ { "@type": "g:Int64", "@value": 6 }, "p01", { "@type": "g:Int64", "@value": 10 }, "aksan", { "@type": "g:Int32", "@value": 29 }]我想要的是结果将显示字段喜欢@fields 或类似这样的东西[ "height":{ "@type": "g:Int64", "@value": 6 }, "code":"p01", "weight":{ "@type": "g:Int64", "@value": 10 }, "name":"aksan", "age":{ "@type": "g:Int32", "@value": 29 }]
- 1 回答
- 0 关注
- 64 浏览
添加回答
举报
0/150
提交
取消