Some linting

This commit is contained in:
George Shammas 2014-07-08 20:32:45 -04:00
parent 049b7e727f
commit eab5de5558
1 changed files with 7 additions and 3 deletions

10
main.go
View File

@ -12,6 +12,9 @@ import (
"github.com/gin-gonic/gin"
)
// Logger is a simple log handler, out puts in the standard of apache access log common
// http://httpd.apache.org/docs/2.2/logs.html#accesslog
func Logger() gin.HandlerFunc {
return func(c *gin.Context) {
t := time.Now()
@ -24,11 +27,9 @@ func Logger() gin.HandlerFunc {
c.Next()
// after request
var user string
user := "-"
if c.Req.URL.User != nil {
user = c.Req.URL.User.Username()
} else {
user = "-"
}
latency := time.Since(t)
@ -94,6 +95,9 @@ func mainHandler(c *gin.Context) {
}
// FileServer is a basic file serve handler, this is just here as an example.
// gin.Static() should be used instead
func FileServer(root string) gin.HandlerFunc {
return func(c *gin.Context) {
file := c.Params.ByName("file")