MCPcopy Create free account
hub / github.com/brimdata/super / UnmarshalJSONFile

Function UnmarshalJSONFile

pkg/fs/jsonfile.go:24–33  ·  view source on GitHub ↗

UnmarshalJSONFile parses JSON-encoded data from the file named by filename and stores the result in the value pointed to by v. Internally, Unmarshal uses json.Unmarshal.

(filename string, v any)

Source from the content-addressed store, hash-verified

22// and stores the result in the value pointed to by v. Internally, Unmarshal
23// uses json.Unmarshal.
24func UnmarshalJSONFile(filename string, v any) error {
25 data, err := ReadFile(filename)
26 if err != nil {
27 return err
28 }
29 if err := json.Unmarshal(data, v); err != nil {
30 return fmt.Errorf("%s: unmarshaling error: %w", filename, err)
31 }
32 return nil
33}

Callers 1

loadPublicKeysFunction · 0.92

Calls 2

ReadFileFunction · 0.70
UnmarshalMethod · 0.45

Tested by

no test coverage detected