[PR #5120] [MERGED] Remove check for negative length #17652

Closed
opened 2025-11-02 14:45:40 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/5120
Author: @cristaloleg
Created: 10/19/2018
Status: Merged
Merged: 10/20/2018
Merged by: @techknowlogick

Base: masterHead: gocritic-sloppyLen


📝 Commits (4)

  • b9e4d1e Remove check for negative length
  • d2f2e0c Merge branch 'master' into gocritic-sloppyLen
  • 5f6621b Merge branch 'master' into gocritic-sloppyLen
  • 71e2a98 Merge branch 'master' into gocritic-sloppyLen

📊 Changes

7 files changed (+8 additions, -8 deletions)

View changed files

📝 models/issue_label.go (+1 -1)
📝 models/org.go (+2 -2)
📝 models/ssh_key.go (+1 -1)
📝 modules/auth/auth.go (+1 -1)
📝 modules/user/user_test.go (+1 -1)
📝 routers/api/v1/api.go (+1 -1)
📝 routers/user/home.go (+1 -1)

📄 Description

Found by go-critic sloppyLen checker

Log:

modules/user/user_test.go:21:5 sloppyLen len(user) <= 0 can be len(user) == 0
models/issue_label.go:137:5 sloppyLen len(labelName) <= 0 can be len(labelName) == 0
models/org.go:680:5 sloppyLen len(repoIDs) <= 0 can be len(repoIDs) == 0
models/org.go:708:5 sloppyLen len(repoIDs) <= 0 can be len(repoIDs) == 0
models/ssh_key.go:379:5 sloppyLen len(key.Fingerprint) <= 0 can be len(key.Fingerprint) == 0
routers/user/home.go:216:5 sloppyLen len(userRepoIDs) <= 0 can be len(userRepoIDs) == 0
routers/api/v1/api.go:83:6 sloppyLen len(sudo) <= 0 can be len(sudo) == 0
modules/auth/auth.go:39:6 sloppyLen len(tokenSHA) <= 0 can be len(tokenSHA) == 0

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/5120 **Author:** [@cristaloleg](https://github.com/cristaloleg) **Created:** 10/19/2018 **Status:** ✅ Merged **Merged:** 10/20/2018 **Merged by:** [@techknowlogick](https://github.com/techknowlogick) **Base:** `master` ← **Head:** `gocritic-sloppyLen` --- ### 📝 Commits (4) - [`b9e4d1e`](https://github.com/go-gitea/gitea/commit/b9e4d1edb828d97b73ffb4b58871441e7f4fbf1a) Remove check for negative length - [`d2f2e0c`](https://github.com/go-gitea/gitea/commit/d2f2e0c25acbaf84c2c3182aa3c2e4b87f650530) Merge branch 'master' into gocritic-sloppyLen - [`5f6621b`](https://github.com/go-gitea/gitea/commit/5f6621bbec155c149ab6b57a8203152e3d12e222) Merge branch 'master' into gocritic-sloppyLen - [`71e2a98`](https://github.com/go-gitea/gitea/commit/71e2a9840b7ec8240711c38958cd2e27d38a1160) Merge branch 'master' into gocritic-sloppyLen ### 📊 Changes **7 files changed** (+8 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `models/issue_label.go` (+1 -1) 📝 `models/org.go` (+2 -2) 📝 `models/ssh_key.go` (+1 -1) 📝 `modules/auth/auth.go` (+1 -1) 📝 `modules/user/user_test.go` (+1 -1) 📝 `routers/api/v1/api.go` (+1 -1) 📝 `routers/user/home.go` (+1 -1) </details> ### 📄 Description Found by go-critic `sloppyLen` checker Log: ``` modules/user/user_test.go:21:5 sloppyLen len(user) <= 0 can be len(user) == 0 models/issue_label.go:137:5 sloppyLen len(labelName) <= 0 can be len(labelName) == 0 models/org.go:680:5 sloppyLen len(repoIDs) <= 0 can be len(repoIDs) == 0 models/org.go:708:5 sloppyLen len(repoIDs) <= 0 can be len(repoIDs) == 0 models/ssh_key.go:379:5 sloppyLen len(key.Fingerprint) <= 0 can be len(key.Fingerprint) == 0 routers/user/home.go:216:5 sloppyLen len(userRepoIDs) <= 0 can be len(userRepoIDs) == 0 routers/api/v1/api.go:83:6 sloppyLen len(sudo) <= 0 can be len(sudo) == 0 modules/auth/auth.go:39:6 sloppyLen len(tokenSHA) <= 0 can be len(tokenSHA) == 0 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 14:45:40 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17652