mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 16:21:09 +00:00
20 lines
380 B
Go
20 lines
380 B
Go
|
package backtest
|
||
|
|
||
|
import "encoding/json"
|
||
|
|
||
|
type Manifests map[InstancePropertyIndex]string
|
||
|
|
||
|
func (m Manifests) MarshalJSON() ([]byte, error) {
|
||
|
var arr []interface{}
|
||
|
for k, v := range m {
|
||
|
arr = append(arr, map[string]interface{}{
|
||
|
"id": k.ID,
|
||
|
"instance": k.InstanceID,
|
||
|
"property": k.Property,
|
||
|
"filename": v,
|
||
|
})
|
||
|
|
||
|
}
|
||
|
return json.MarshalIndent(arr, "", " ")
|
||
|
}
|