MCPcopy Create free account
hub / github.com/wquguru/nof0 / loadJSONFile

Method loadJSONFile

go/internal/data/loader.go:131–138  ·  view source on GitHub ↗

Helper function to load JSON file

(filename string, v interface{})

Source from the content-addressed store, hash-verified

129
130// Helper function to load JSON file
131func (dl *DataLoader) loadJSONFile(filename string, v interface{}) error {
132 filePath := filepath.Join(dl.dataPath, filename)
133 data, err := os.ReadFile(filePath)
134 if err != nil {
135 return err
136 }
137 return json.Unmarshal(data, v)
138}
139
140// LoadPositions loads positions from JSON file
141func (dl *DataLoader) LoadPositions() (*types.PositionsResponse, error) {

Callers 10

TestLoadInvalidJSONFunction · 0.95
LoadCryptoPricesMethod · 0.95
LoadAccountTotalsMethod · 0.95
LoadTradesMethod · 0.95
LoadSinceInceptionMethod · 0.95
LoadLeaderboardMethod · 0.95
LoadAnalyticsMethod · 0.95
LoadModelAnalyticsMethod · 0.95
LoadPositionsMethod · 0.95
LoadConversationsMethod · 0.95

Calls

no outgoing calls

Tested by 1

TestLoadInvalidJSONFunction · 0.76