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

Method ToJSONWithIndent

config/persist.go:35–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33}
34
35func (c *Config) ToJSONWithIndent() ([]byte, error) {
36 data, err := json.MarshalIndent(c, "", " ")
37 if err != nil {
38 return nil, fmt.Errorf("Failed to convert to JSON: %s", err.Error())
39 }
40
41 return data, nil
42}
43
44func (c *Config) ToYAML() ([]byte, error) {
45 data, err := yaml.Marshal(c)

Callers 2

RunMethod · 0.95

Calls 1

ErrorMethod · 0.80

Tested by 1