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

Function parseVariableValuesFromCommandLine

codersdk/templatevariables.go:238–252  ·  view source on GitHub ↗
(variables []string)

Source from the content-addressed store, hash-verified

236}
237
238func parseVariableValuesFromCommandLine(variables []string) ([]VariableValue, error) {
239 var values []VariableValue
240 for _, keyValue := range variables {
241 split := strings.SplitN(keyValue, "=", 2)
242 if len(split) < 2 {
243 return nil, xerrors.Errorf("format key=value expected, but got %s", keyValue)
244 }
245
246 values = append(values, VariableValue{
247 Name: split[0],
248 Value: split[1],
249 })
250 }
251 return values, nil
252}
253
254func CombineVariableValues(valuesSets ...[]VariableValue) []VariableValue {
255 combinedValues := make(map[string]string)

Callers 1

ParseUserVariableValuesFunction · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by

no test coverage detected