From ec87a75c000d52bfc2a8dcfc7097c14fe872c376 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 27 Nov 2016 14:03:59 +0800 Subject: golint fixed for modules/auth --- modules/auth/admin.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/auth/admin.go') 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) } -- cgit v1.2.3