Open
Description
Currently this is how variables in VariableGroup are parsed
type VariableGroup struct {
.....
// Gets or sets variables contained in the variable group.
Variables **map[string]interface{} `json:"variables,omitempty"`
}
In order to get the value of a specific variable, we need to some type assertion:
for key, variable := range *variableGroup.Variables {
value := variable.(map[string]interface{})["value"]
log.Printf("Variable Name: %v, Value: %v", key, value)
}
Could we not do this instead?
type VariableGroup struct {
.....
// Gets or sets variables contained in the variable group.
Variables *map[string]map[string]interface{} `json:"variables,omitempty"`
}
Therefore we could get the value, this way:
for key, variable := range *variableGroup.Variables {
vari := variable["value"]
log.Printf("Variable Name: %v, Value: %v", key, vari)
}
Metadata
Metadata
Assignees
Labels
No labels