1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 09:30:56 +00:00

errors is better style

This commit is contained in:
JessonChan 2019-01-22 16:23:10 +08:00
parent 80aabdd372
commit 30b80cba92

View File

@ -15,6 +15,7 @@
package beego
import (
"errors"
"fmt"
"net/http"
"path"
@ -479,8 +480,7 @@ func (p *ControllerRegister) InsertFilter(pattern string, pos int, filter Filter
// add Filter into
func (p *ControllerRegister) insertFilterRouter(pos int, mr *FilterRouter) (err error) {
if pos < BeforeStatic || pos > FinishRouter {
err = fmt.Errorf("can not find your filter position")
return
return errors.New("can not find your filter position")
}
p.enableFilter = true
p.filters[pos] = append(p.filters[pos], mr)