mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promrelabel: return correct string representation for IfExpression containing a single selector
This is a follow-up for 62651570bb
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4635
This commit is contained in:
parent
56c17d16f6
commit
ad08d9c884
1 changed files with 4 additions and 1 deletions
|
@ -141,7 +141,10 @@ func newIfExpression(s string) (*ifExpression, error) {
|
||||||
// String returns string representation of ie.
|
// String returns string representation of ie.
|
||||||
func (ie *IfExpression) String() string {
|
func (ie *IfExpression) String() string {
|
||||||
if ie == nil {
|
if ie == nil {
|
||||||
return "[]"
|
return "{}"
|
||||||
|
}
|
||||||
|
if len(ie.ies) == 1 {
|
||||||
|
return ie.ies[0].String()
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s", ie.ies)
|
return fmt.Sprintf("%s", ie.ies)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue