This commit is contained in:
crusader 2018-04-20 11:37:07 +09:00
parent 2eacff61a0
commit 2eb0a778e0

View File

@ -4,3 +4,14 @@ type Keys struct {
Metric string `json:"metric,omitempty"` Metric string `json:"metric,omitempty"`
Key string `json:"key,omitempty"` Key string `json:"key,omitempty"`
} }
func KeysToMap(keys []Keys) map[string]string {
m := make(map[string]string)
for _, key := range keys {
m[key.Key] = key.Metric
}
return m
}