tidwall / sjson

Set JSON values very quickly in Go
MIT License
2.41k stars 165 forks source link

JSON anonymous object #6

Closed Akagi201 closed 6 years ago

Akagi201 commented 7 years ago
[
{
    "client_id": 1000,
    "edge_ip": "xx.xx.xx.xx",
    "edge_port": port1,
    "timestamp":123456
},
{
    "client_id": 1001,
    "edge_ip": "yy.yy.yy.yy",
    "edge_port": port2,
    "timestamp":123456
}
]

How can I set the client_id with sjson?

tidwall commented 7 years ago
sjson.Set(json, "1.client_id", 1002)

Will change the client_id object at index 1 to 1002.