From 5a4648cdd697be92d33be55cd85069365cce2588 Mon Sep 17 00:00:00 2001 From: Oleg Kovalov Date: Sat, 20 Oct 2018 23:25:14 +0200 Subject: Remove check for negative length (#5120) --- modules/auth/auth.go | 2 +- modules/user/user_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 8391e7de8f..0d703084da 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -36,7 +36,7 @@ func SignedInID(ctx *macaron.Context, sess session.Store) int64 { // Check access token. if IsAPIPath(ctx.Req.URL.Path) { tokenSHA := ctx.Query("token") - if len(tokenSHA) <= 0 { + if len(tokenSHA) == 0 { tokenSHA = ctx.Query("access_token") } if len(tokenSHA) == 0 { diff --git a/modules/user/user_test.go b/modules/user/user_test.go index 51f10dbbd2..ae7460281f 100644 --- a/modules/user/user_test.go +++ b/modules/user/user_test.go @@ -18,7 +18,7 @@ func getWhoamiOutput() (string, error) { func TestCurrentUsername(t *testing.T) { user := CurrentUsername() - if len(user) <= 0 { + if len(user) == 0 { t.Errorf("expected non-empty user, got: %s", user) } // Windows whoami is weird, so just skip remaining tests -- cgit v1.2.3