MCPcopy Create free account
hub / github.com/hashicorp/vault / parseArgsDataString

Function parseArgsDataString

command/base_helpers.go:146–160  ·  view source on GitHub ↗

parseArgsDataString parses the args data and returns the values as strings. If the values cannot be represented as strings, an error is returned.

(stdin io.Reader, args []string)

Source from the content-addressed store, hash-verified

144// parseArgsDataString parses the args data and returns the values as strings.
145// If the values cannot be represented as strings, an error is returned.
146func parseArgsDataString(stdin io.Reader, args []string) (map[string]string, error) {
147 raw, err := parseArgsData(stdin, args)
148 if err != nil {
149 return nil, err
150 }
151
152 var result map[string]string
153 if err := mapstructure.WeakDecode(raw, &result); err != nil {
154 return nil, errors.Wrap(err, "failed to convert values to strings")
155 }
156 if result == nil {
157 result = make(map[string]string)
158 }
159 return result, nil
160}
161
162// parseArgsDataStringLists parses the args data and returns the values as
163// string lists. If the values cannot be represented as strings, an error is

Callers 2

RunMethod · 0.85
RunMethod · 0.85

Calls 2

parseArgsDataFunction · 0.85
WrapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…