MCPcopy Index your code
hub / github.com/deepflowio/deepflow / dictToString

Method dictToString

server/agent_config/template_json.go:746–758  ·  view source on GitHub ↗
(data interface{})

Source from the content-addressed store, hash-verified

744}
745
746func (f *DataFormatter) dictToString(data interface{}) (string, error) {
747 if str, ok := data.(string); ok {
748 return f.listToString(str)
749 }
750 var buf strings.Builder
751 enc := yaml.NewEncoder(&buf)
752 enc.SetIndent(2)
753 err := enc.Encode(data)
754 if err != nil {
755 return "", err
756 }
757 return buf.String(), nil
758}
759
760func (f *DataFormatter) listToString(data string) (string, error) {
761 var list []interface{}

Callers 2

mapToYAMLMethod · 0.95
fmtValMethod · 0.95

Calls 3

listToStringMethod · 0.95
EncodeMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected