MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / yamlScalarString

Function yamlScalarString

internal/pluginhost/config.go:127–139  ·  view source on GitHub ↗
(node *yaml.Node)

Source from the content-addressed store, hash-verified

125}
126
127func yamlScalarString(node *yaml.Node) string {
128 if node == nil || node.Kind == 0 {
129 return ""
130 }
131 if node.Kind == yaml.ScalarNode {
132 return strings.TrimSpace(node.Value)
133 }
134 var value string
135 if errDecode := node.Decode(&value); errDecode != nil {
136 return ""
137 }
138 return strings.TrimSpace(value)
139}
140
141func yamlMappingValue(node *yaml.Node, key string) *yaml.Node {
142 if node == nil || node.Kind != yaml.MappingNode {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected