【发布时间】:2021-12-09 23:33:48
【问题描述】:
下面的类型定义:
type tuple struct{
key string
value string
}
type identifier struct{
metricName tuple
labels []tuple
}
type value struct{
timestamp int64
timeSeriesValue float64
}
type DataModel map[identifier][]value
给出错误:invalid map key type identifier
struct 类型可以是 Go 中的键
identifier 类型没有可比性吗?
【问题讨论】:
标签: dictionary go