fix index slice append
This commit is contained in:
parent
c59cb74f12
commit
56f8241ea5
|
@ -244,7 +244,7 @@ func IndexList() []*model.Instance {
|
|||
return []*model.Instance{}
|
||||
}
|
||||
|
||||
instances := make([]*model.Instance, len(activeIndexes))
|
||||
var instances []*model.Instance
|
||||
for _, instance := range activeIndexes {
|
||||
if instance.Identity != identity.Identity {
|
||||
instances = append(instances, instance)
|
||||
|
|
|
@ -107,7 +107,7 @@ func (m *MetricIndexMap) GetMetrics() []string {
|
|||
m.RLock()
|
||||
defer m.RUnlock()
|
||||
|
||||
metrics := make([]string, len(m.Data))
|
||||
var metrics []string
|
||||
for k := range m.Data {
|
||||
metrics = append(metrics, k)
|
||||
}
|
||||
|
|
|
@ -30,9 +30,9 @@ func (t *TagkvIndex) GetTagkv() []*TagPair {
|
|||
t.RLock()
|
||||
defer t.RUnlock()
|
||||
|
||||
tagkvs := make([]*TagPair, len(t.Tagkv))
|
||||
var tagkvs []*TagPair
|
||||
for k, vm := range t.Tagkv {
|
||||
vs := make([]string, len(vm))
|
||||
var vs []string
|
||||
for v := range vm {
|
||||
vs = append(vs, v)
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func (t *TagkvIndex) GetTagkvMap() map[string][]string {
|
|||
|
||||
tagkvs := make(map[string][]string)
|
||||
for k, vm := range t.Tagkv {
|
||||
vs := make([]string, len(vm))
|
||||
var vs []string
|
||||
for v := range vm {
|
||||
vs = append(vs, v)
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ func GetTagPairs(c *gin.Context) {
|
|||
}
|
||||
|
||||
for tagk, tagvFilter := range tagkvFilter {
|
||||
tagvs := make([]string, len(tagvFilter))
|
||||
var tagvs []string
|
||||
for v := range tagvFilter {
|
||||
tagvs = append(tagvs, v)
|
||||
}
|
||||
|
|
|
@ -58,8 +58,8 @@ func main() {
|
|||
tlogger.Init(cfg.Logger)
|
||||
go stats.Init("n9e.index")
|
||||
|
||||
cache.InitDB(cfg.Cache)
|
||||
identity.Init(cfg.Identity)
|
||||
cache.InitDB(cfg.Cache)
|
||||
|
||||
go report.Init(cfg.Report, "monapi")
|
||||
go rpc.Start()
|
||||
|
|
Loading…
Reference in New Issue