Skip to content

Commit

Permalink
admin: init pattern2Handler to avoid panic (#90)
Browse files Browse the repository at this point in the history
panic:assignment to entry in nil map
  • Loading branch information
liuzengh authored Oct 17, 2023
1 parent 21cd21b commit cbdbbdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (s *Server) close() {
s.closeErr = s.server.Close()
}

var pattern2Handler map[string]http.HandlerFunc
var pattern2Handler = make(map[string]http.HandlerFunc)

// HandleFunc registers the handler function for the given pattern.
// Each time NewServer is called, all handlers registered through HandleFunc will be in effect.
Expand Down

0 comments on commit cbdbbdb

Please sign in to comment.