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

Function decodeJSON

internal/config/config.go:152–164  ·  view source on GitHub ↗
(r io.Reader)

Source from the content-addressed store, hash-verified

150}
151
152func decodeJSON(r io.Reader) (any, error) {
153 body, err := io.ReadAll(r)
154 if err != nil {
155 return nil, err
156 }
157 body = bytes.TrimPrefix(body, []byte{0xEF, 0xBB, 0xBF})
158
159 var payload any
160 if err := json.Unmarshal(body, &payload); err != nil {
161 return nil, err
162 }
163 return payload, nil
164}

Callers 1

readJSONFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected