feiyu563 / PrometheusAlert

Prometheus Alert是开源的运维告警中心消息转发系统,支持主流的监控系统Prometheus,Zabbix,日志系统Graylog和数据可视化系统Grafana发出的预警消息,支持钉钉,微信,华为云短信,腾讯云短信,腾讯云电话,阿里云短信,阿里云电话等
https://feiyu563.gitbook.io
MIT License
2.85k stars 678 forks source link

controllers/default.go:33:2: struct field Aliyun repeats json tag "prometheusalert" also at default.go:32 #279

Closed OPSTime closed 1 year ago

OPSTime commented 1 year ago

$ make

>> formatting code
go fmt PrometheusAlert PrometheusAlert/controllers PrometheusAlert/models PrometheusAlert/models/elastic PrometheusAlert/routers PrometheusAlert/tests PrometheusAlert/zabbixclient
controllers/gitlab_test.go
>> vetting code
go vet PrometheusAlert PrometheusAlert/controllers PrometheusAlert/models PrometheusAlert/models/elastic PrometheusAlert/routers PrometheusAlert/tests PrometheusAlert/zabbixclient
# PrometheusAlert/controllers
controllers/default.go:33:2: struct field Aliyun repeats json tag "prometheusalert" also at default.go:32
make: *** [Makefile:27: vet] Error 2
OPSTime commented 1 year ago

如下DashboardJson struct中导致

$ vim controllers/default.go

package controllers

import (
    "PrometheusAlert/models"
    "github.com/astaxie/beego"
)

type DashboardJson struct {
    Telegram        int `json:"telegram"`
    Smoordx         int `json:"smoordx"`
    Smoordh         int `json:"smoordh"`
    Alydx           int `json:"alydx"`
    Alydh           int `json:"alydh"`
    Bdydx           int `json:"bdydx"`
    Bark            int `json:"bark"`
    Dingding        int `json:"dingding"`
    Email           int `json:"email"`
    Feishu          int `json:"feishu"`
    Hwdx            int `json:"hwdx"`
    Rlydx           int `json:"rlydx"`
    Ruliu           int `json:"ruliu"`
    Txdx            int `json:"txdx"`
    Txdh            int `json:"txdh"`
    Webhook         int `json:"webhook"`
    Weixin          int `json:"weixin"`
    Workwechat      int `json:"workwechat"`
    Voice           int `json:"voice"`
    Zabbix          int `json:"zabbix"`
    Grafana         int `json:"grafana"`
    Graylog         int `json:"graylog"`
    Prometheus      int `json:"prometheus"`
    Prometheusalert int `json:"prometheusalert"`
    Aliyun          int `json:"prometheusalert"`

}
feiyu563 commented 1 year ago

问题已经修正