MCPcopy Create free account
hub / github.com/NoFxAiOS/nofx / extractJSONPath

Function extractJSONPath

kernel/engine.go:999–1012  ·  view source on GitHub ↗
(data interface{}, path string)

Source from the content-addressed store, hash-verified

997}
998
999func extractJSONPath(data interface{}, path string) interface{} {
1000 parts := strings.Split(path, ".")
1001 current := data
1002
1003 for _, part := range parts {
1004 if m, ok := current.(map[string]interface{}); ok {
1005 current = m[part]
1006 } else {
1007 return nil
1008 }
1009 }
1010
1011 return current
1012}
1013
1014// FetchQuantData fetches quantitative data for a single coin
1015func (e *StrategyEngine) FetchQuantData(symbol string) (*QuantData, error) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected