MCPcopy Create free account
hub / github.com/coldbrewcloud/coldbrew-cli / FromJSON

Method FromJSON

config/persist.go:10–16  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

8)
9
10func (c *Config) FromJSON(data []byte) error {
11 if err := json.Unmarshal(data, c); err != nil {
12 return fmt.Errorf("Failed to parse JSON: %s", err.Error())
13 }
14
15 return nil
16}
17
18func (c *Config) FromYAML(data []byte) error {
19 if err := yaml.Unmarshal(data, c); err != nil {

Callers 5

TestConfig_FromJSONFunction · 0.95
TestConfig_ToJSONFunction · 0.95
TestConfig_YAMLJSONFunction · 0.95
LoadFunction · 0.95

Calls 1

ErrorMethod · 0.80

Tested by 4

TestConfig_FromJSONFunction · 0.76
TestConfig_ToJSONFunction · 0.76
TestConfig_YAMLJSONFunction · 0.76