From 853f3d91c9f1d18ed10804f9301866d4f143ca45 Mon Sep 17 00:00:00 2001 From: kunw Date: Thu, 16 Jun 2016 14:26:33 +0800 Subject: [PATCH] updates for meeting golint check. --- controllers/base.go | 14 +++++++------- controllers/navigationdetail.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/controllers/base.go b/controllers/base.go index 467cb95ed..e8b67f908 100644 --- a/controllers/base.go +++ b/controllers/base.go @@ -114,9 +114,9 @@ func (cc *CommonController) Render() error { } // Login handles login request from UI. -func (c *CommonController) Login() { - principal := c.GetString("principal") - password := c.GetString("password") +func (cc *CommonController) Login() { + principal := cc.GetString("principal") + password := cc.GetString("password") user, err := auth.Login(models.AuthModel{ Principal: principal, @@ -124,15 +124,15 @@ func (c *CommonController) Login() { }) if err != nil { log.Errorf("Error occurred in UserLogin: %v", err) - c.CustomAbort(http.StatusUnauthorized, "") + cc.CustomAbort(http.StatusUnauthorized, "") } if user == nil { - c.CustomAbort(http.StatusUnauthorized, "") + cc.CustomAbort(http.StatusUnauthorized, "") } - c.SetSession("userId", user.UserID) - c.SetSession("username", user.Username) + cc.SetSession("userId", user.UserID) + cc.SetSession("username", user.Username) } // LogOut Habor UI diff --git a/controllers/navigationdetail.go b/controllers/navigationdetail.go index 27532ffac..2de56ef41 100644 --- a/controllers/navigationdetail.go +++ b/controllers/navigationdetail.go @@ -8,7 +8,7 @@ import ( "github.com/vmware/harbor/utils/log" ) -// NavigationHeaderController handles requests to /navigation_detail +// NavigationDetailController handles requests to /navigation_detail type NavigationDetailController struct { BaseController }