Files
EdgeAPI/internal/db/models/metric_chart_model_ext.go

18 lines
305 B
Go
Raw Permalink Normal View History

2021-07-03 15:45:04 +08:00
package models
import "encoding/json"
func (this *MetricChart) DecodeIgnoredKeys() []string {
if len(this.IgnoredKeys) == 0 {
return []string{}
}
var result = []string{}
2022-03-22 19:30:30 +08:00
err := json.Unmarshal(this.IgnoredKeys, &result)
if err != nil {
// 这里忽略错误
return result
}
return result
}