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

Method ToJSON

config/persist.go:26–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26func (c *Config) ToJSON() ([]byte, error) {
27 data, err := json.Marshal(c)
28 if err != nil {
29 return nil, fmt.Errorf("Failed to convert to JSON: %s", err.Error())
30 }
31
32 return data, nil
33}
34
35func (c *Config) ToJSONWithIndent() ([]byte, error) {
36 data, err := json.MarshalIndent(c, "", " ")

Callers 2

TestConfig_YAMLJSONFunction · 0.95
TestConfig_ToJSONFunction · 0.80

Calls 1

ErrorMethod · 0.80

Tested by 2

TestConfig_YAMLJSONFunction · 0.76
TestConfig_ToJSONFunction · 0.64