MCPcopy Create free account
hub / github.com/devspace-sh/devspace / ParseFile

Function ParseFile

pkg/util/strvals/strvals.go:98–104  ·  view source on GitHub ↗

ParseFile parses a set line, but its final value is loaded from the file at the path specified by the original value. A set line is of the form name1=path1,name2=path2 When the files at path1 and path2 contained "val1" and "val2" respectively, the set line is consumed as name1=val1,name2=val2

(s string, reader RunesValueReader)

Source from the content-addressed store, hash-verified

96// When the files at path1 and path2 contained "val1" and "val2" respectively, the set line is consumed as
97// name1=val1,name2=val2
98func ParseFile(s string, reader RunesValueReader) (map[string]interface{}, error) {
99 vals := map[string]interface{}{}
100 scanner := bytes.NewBufferString(s)
101 t := newFileParser(scanner, vals, reader)
102 err := t.parse()
103 return vals, err
104}
105
106// ParseIntoString parses a strvals line and merges the result into dest.
107//

Callers

nothing calls this directly

Calls 2

newFileParserFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected