MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / unmarshal

Function unmarshal

controller/system/import.go:37–45  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

35)
36
37func unmarshal[T any](name string) ([]*T, error) {
38 data, err := importConfigs.ReadFile(fmt.Sprintf("config/%s.json", name))
39 if err != nil {
40 return nil, fmt.Errorf("fail to read file(%s): %v", name, err)
41 }
42 t := make([]*T, 0)
43 err = json.Unmarshal(data, &t)
44 return t, err
45}
46
47var (
48 _ IImportConfigController = (*imlImportConfigController)(nil)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected