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:
Karsten Weiss 2018-04-16 20:22:12 +02:00
parent cb3b9f8b66
commit 4d87cb03c5
2 changed files with 3 additions and 3 deletions

View File

@ -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)
}

View File

@ -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