AddVariableDecls adds one or more variables to the config, converting them to serializable values first. VariableDecl inputs are expected to be well-formed.
(vars ...*decls.VariableDecl)
| 116 | // |
| 117 | // VariableDecl inputs are expected to be well-formed. |
| 118 | func (c *Config) AddVariableDecls(vars ...*decls.VariableDecl) *Config { |
| 119 | convVars := make([]*Variable, len(vars)) |
| 120 | for i, v := range vars { |
| 121 | if v == nil { |
| 122 | continue |
| 123 | } |
| 124 | cv := NewVariable(v.Name(), SerializeTypeDesc(v.Type())) |
| 125 | cv.Description = v.Description() |
| 126 | convVars[i] = cv |
| 127 | } |
| 128 | return c.AddVariables(convVars...) |
| 129 | } |
| 130 | |
| 131 | // AddVariables adds one or more variables to the config. |
| 132 | func (c *Config) AddVariables(vars ...*Variable) *Config { |