Commit 4d87cb03 by Karsten Weiss

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)
parent cb3b9f8b
......@@ -139,7 +139,7 @@ func (hs *HTTPServer) listenAndServeTLS(certfile, keyfile string) error {
}
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)
}
......
......@@ -15,7 +15,7 @@ type SchedulerImpl struct {
func NewScheduler() Scheduler {
return &SchedulerImpl{
jobs: make(map[int64]*Job, 0),
jobs: make(map[int64]*Job),
log: log.New("alerting.scheduler"),
}
}
......@@ -23,7 +23,7 @@ func NewScheduler() Scheduler {
func (s *SchedulerImpl) Update(rules []*Rule) {
s.log.Debug("Scheduling update", "ruleCount", len(rules))
jobs := make(map[int64]*Job, 0)
jobs := make(map[int64]*Job)
for i, rule := range rules {
var job *Job
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment