MCPcopy Create free account
hub / github.com/MMadmer/EpicAssetsNotifyBot / readJSONFile

Function readJSONFile

internal/config/config.go:138–150  ·  view source on GitHub ↗
(path string, fallback any)

Source from the content-addressed store, hash-verified

136}
137
138func readJSONFile(path string, fallback any) any {
139 f, err := os.Open(path)
140 if err != nil {
141 return fallback
142 }
143 defer f.Close()
144
145 payload, err := decodeJSON(f)
146 if err != nil {
147 return fallback
148 }
149 return payload
150}
151
152func decodeJSON(r io.Reader) (any, error) {
153 body, err := io.ReadAll(r)

Callers 1

LoadLegacySnapshotFunction · 0.85

Calls 2

decodeJSONFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected