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/admin.go | |
parent | e6da2cf2cbff4d550cf938548233a59ceef6528e (diff) | |
download | gitea-ec87a75c000d52bfc2a8dcfc7097c14fe872c376.tar.gz gitea-ec87a75c000d52bfc2a8dcfc7097c14fe872c376.zip |
golint fixed for modules/auth
Diffstat (limited to 'modules/auth/admin.go')
-rw-r--r-- | modules/auth/admin.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/auth/admin.go b/modules/auth/admin.go index 58d1a027fc..033dfe9388 100644 --- a/modules/auth/admin.go +++ b/modules/auth/admin.go @@ -10,7 +10,8 @@ import ( "github.com/go-macaron/binding" ) -type AdminCrateUserForm struct { +// AdminCreateUserForm form for admin to create user +type AdminCreateUserForm struct { LoginType string `binding:"Required"` LoginName string UserName string `binding:"Required;AlphaDashDot;MaxSize(35)"` @@ -19,10 +20,12 @@ type AdminCrateUserForm struct { SendNotify bool } -func (f *AdminCrateUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { +// Validate validates form fields +func (f *AdminCreateUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } +// AdminEditUserForm form for admin to create user type AdminEditUserForm struct { LoginType string `binding:"Required"` LoginName string @@ -39,6 +42,7 @@ type AdminEditUserForm struct { ProhibitLogin bool } +// Validate validates form fields func (f *AdminEditUserForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { return validate(errs, ctx.Data, f, ctx.Locale) } |