mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Simplify make() (gosimple)
This fixes: pkg/api/http_server.go:142:89: should use make(map[string]func(*http.Server, *tls.Conn, http.Handler)) instead (S1019) pkg/services/alerting/scheduler.go:18:30: should use make(map[int64]*Job) instead (S1019) pkg/services/alerting/scheduler.go:26:31: should use make(map[int64]*Job) instead (S1019)
This commit is contained in:
@@ -139,7 +139,7 @@ func (hs *HTTPServer) listenAndServeTLS(certfile, keyfile string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hs.httpSrv.TLSConfig = tlsCfg
|
hs.httpSrv.TLSConfig = tlsCfg
|
||||||
hs.httpSrv.TLSNextProto = make(map[string]func(*http.Server, *tls.Conn, http.Handler), 0)
|
hs.httpSrv.TLSNextProto = make(map[string]func(*http.Server, *tls.Conn, http.Handler))
|
||||||
|
|
||||||
return hs.httpSrv.ListenAndServeTLS(setting.CertFile, setting.KeyFile)
|
return hs.httpSrv.ListenAndServeTLS(setting.CertFile, setting.KeyFile)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type SchedulerImpl struct {
|
|||||||
|
|
||||||
func NewScheduler() Scheduler {
|
func NewScheduler() Scheduler {
|
||||||
return &SchedulerImpl{
|
return &SchedulerImpl{
|
||||||
jobs: make(map[int64]*Job, 0),
|
jobs: make(map[int64]*Job),
|
||||||
log: log.New("alerting.scheduler"),
|
log: log.New("alerting.scheduler"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ func NewScheduler() Scheduler {
|
|||||||
func (s *SchedulerImpl) Update(rules []*Rule) {
|
func (s *SchedulerImpl) Update(rules []*Rule) {
|
||||||
s.log.Debug("Scheduling update", "ruleCount", len(rules))
|
s.log.Debug("Scheduling update", "ruleCount", len(rules))
|
||||||
|
|
||||||
jobs := make(map[int64]*Job, 0)
|
jobs := make(map[int64]*Job)
|
||||||
|
|
||||||
for i, rule := range rules {
|
for i, rule := range rules {
|
||||||
var job *Job
|
var job *Job
|
||||||
|
|||||||
Reference in New Issue
Block a user