Skip to content

Commit

Permalink
Panic in case of nil specs in NewAnalyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
Peltoche committed Oct 1, 2018
1 parent 6be3379 commit 05dd504
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Analyzer struct {

func NewAnalyzer(specs *Specs) *Analyzer {
if specs == nil {
return &Analyzer{}
panic("specs is nil")
}

return &Analyzer{
Expand Down Expand Up @@ -60,10 +60,6 @@ func createRouter(analyzer *analysis.Spec) *denco.Router {
}

func (t *Analyzer) Analyze(req *http.Request) error {
if t.analyzer == nil {
return errors.New("no specs defined")
}

if req == nil {
return errors.New("no request defined")
}
Expand Down

0 comments on commit 05dd504

Please sign in to comment.