Hello,
I need to create the following JSON-File:
[{
"key": "Series 1",
"values": [
[
1051675200000,
0.44227126150934
],
[
1054353600000,
7.2481659343222
],
[
1056945600000,
9.2512381306992
],
[
1059624000000,
11.341210982529
]
]
}, {
"key": "Series 2",
"values": [
[
1025409600000,
0
],
[
1028088000000,
0
],
[
1030766400000,
0
],
[
1033358400000,
0
]
]
}, {
"key": "Series 3",
"values": [
[
1025409600000, -14.663359292964
]
]
}]
The JSON to Struct converter gives me the following autogenerated struct:
type AutoGenerated []struct {
Key string `json:"key"`
Values []struct {
Num0 int64 `json:"0"`
Num1 float64 `json:"1"`
} `json:"values"`
}
How can I fill the struct dynamically. There are values from a database.
Sometimes I have two series with 100 Values, sometimes I have one series
with 30 values. or something like that.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.