mirror of
https://github.com/gogs/gogs.git
synced 2025-12-22 08:09:59 +01:00
autofix: fix check for empty string (#6804)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
65526f84e1
commit
deec3516d5
@@ -38,7 +38,7 @@ func Home(c *context.Context) {
|
||||
|
||||
// Check auto-login.
|
||||
uname := c.GetCookie(conf.Security.CookieUsername)
|
||||
if len(uname) != 0 {
|
||||
if uname != "" {
|
||||
c.Redirect(conf.Server.Subpath + "/user/login")
|
||||
return
|
||||
}
|
||||
@@ -104,7 +104,7 @@ func RenderUserSearch(c *context.Context, opts *UserSearchOptions) {
|
||||
)
|
||||
|
||||
keyword := c.Query("q")
|
||||
if len(keyword) == 0 {
|
||||
if keyword == "" {
|
||||
users, err = opts.Ranger(page, opts.PageSize)
|
||||
if err != nil {
|
||||
c.Error(err, "ranger")
|
||||
|
||||
Reference in New Issue
Block a user