diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2016-11-27 14:03:59 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2016-11-27 21:39:06 +0800 |
commit | ec87a75c000d52bfc2a8dcfc7097c14fe872c376 (patch) | |
tree | d849fb1070fe15136538404127099e9a7e0dd302 /modules/auth/auth.go | |
parent | e6da2cf2cbff4d550cf938548233a59ceef6528e (diff) | |
download | gitea-ec87a75c000d52bfc2a8dcfc7097c14fe872c376.tar.gz gitea-ec87a75c000d52bfc2a8dcfc7097c14fe872c376.zip |
golint fixed for modules/auth
Diffstat (limited to 'modules/auth/auth.go')
-rw-r--r-- | modules/auth/auth.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 2444a3ad1f..ed94d0a698 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -21,6 +21,7 @@ import ( "code.gitea.io/gitea/modules/setting" ) +// IsAPIPath if URL is an api path func IsAPIPath(url string) bool { return strings.HasPrefix(url, "/api/") } @@ -110,9 +111,8 @@ func SignedInUser(ctx *macaron.Context, sess session.Store) (*models.User, bool) // FIXME: should I create a system notice? log.Error(4, "CreateUser: %v", err) return nil, false - } else { - return u, false } + return u, false } } return u, false @@ -148,6 +148,7 @@ func SignedInUser(ctx *macaron.Context, sess session.Store) (*models.User, bool) return u, false } +// Form form binding interface type Form interface { binding.Validator } @@ -190,18 +191,22 @@ func getRuleBody(field reflect.StructField, prefix string) string { return "" } +// GetSize get size int form tag func GetSize(field reflect.StructField) string { return getRuleBody(field, "Size(") } +// GetMinSize get minimal size in form tag func GetMinSize(field reflect.StructField) string { return getRuleBody(field, "MinSize(") } +// GetMaxSize get max size in form tag func GetMaxSize(field reflect.StructField) string { return getRuleBody(field, "MaxSize(") } +// GetInclude get include in form tag func GetInclude(field reflect.StructField) string { return getRuleBody(field, "Include(") } |