I've troubles with parsing json array of arrays using golang, all of them without names:
[[1594561500000, 1031.47571376], [1594562500000, 1031.43571376],[1595561500000, 1041.41376]]
Could you help me with it?
Don't forget to convert the string you use to hold the JSON to []byte first:
package main
import (
"encoding/json"
"fmt"
"log"
)
func main() {
s := []byte(`[[1594561500000, 1031.47571376], [1594562500000, 1031.43571376],[1595561500000, 1041.41376]]`)
var nums [][]float64
if err := json.Unmarshal(s, &nums); err != nil {
log.Fatal(err)
}
fmt.Println(nums)
}
var v [][]float64; json.Unmarshal(input,&v)