make golint happy staticfile.go

This commit is contained in:
astaxie 2015-09-08 22:07:44 +08:00
parent b2048e8653
commit 8615f875f8
1 changed files with 6 additions and 8 deletions

View File

@ -40,15 +40,13 @@ func serverStaticRouter(ctx *context.Context) {
if utils.FileExists(file) {
http.ServeFile(ctx.ResponseWriter, ctx.Request, file)
return
} else {
i++
if i == len(StaticDir) {
http.NotFound(ctx.ResponseWriter, ctx.Request)
return
} else {
continue
}
}
i++
if i == len(StaticDir) {
http.NotFound(ctx.ResponseWriter, ctx.Request)
return
}
continue
}
if strings.HasPrefix(requestPath, prefix) {
if len(requestPath) > len(prefix) && requestPath[len(prefix)] != '/' {