MCPcopy Index your code
hub / github.com/coder/coder / parseVariableValuesFromFile

Function parseVariableValuesFromFile

codersdk/templatevariables.go:198–216  ·  view source on GitHub ↗
(variablesFile string)

Source from the content-addressed store, hash-verified

196}
197
198func parseVariableValuesFromFile(variablesFile string) ([]VariableValue, error) {
199 var values []VariableValue
200 if variablesFile == "" {
201 return values, nil
202 }
203
204 variablesMap, err := createVariablesMapFromFile(variablesFile)
205 if err != nil {
206 return nil, err
207 }
208
209 for name, value := range variablesMap {
210 values = append(values, VariableValue{
211 Name: name,
212 Value: value,
213 })
214 }
215 return values, nil
216}
217
218// Reads a YAML file and populates a string -> string map.
219// Throws an error if the file name is empty.

Callers 1

ParseUserVariableValuesFunction · 0.85

Calls 1

Tested by

no test coverage detected