1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-09 11:08:19 +00:00

Fix remaining issues after gopls modernize formatting (#34771)

Followup https://github.com/go-gitea/gitea/pull/34751, fix all remaining
marked issues.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
silverwind
2025-06-18 20:37:49 +02:00
committed by GitHub
parent a2ae7c69da
commit 46a1d52235
7 changed files with 10 additions and 42 deletions

View File

@@ -99,11 +99,7 @@ func Install(ctx *context.Context) {
form.SSLMode = setting.Database.SSLMode
curDBType := setting.Database.Type.String()
var isCurDBTypeSupported bool
if slices.Contains(setting.SupportedDatabaseTypes, curDBType) {
isCurDBTypeSupported = true
}
if !isCurDBTypeSupported {
if !slices.Contains(setting.SupportedDatabaseTypes, curDBType) {
curDBType = "mysql"
}
ctx.Data["CurDbType"] = curDBType

View File

@@ -94,11 +94,7 @@ func Code(ctx *context.Context) {
loadRepoIDs := make([]int64, 0, len(searchResults))
for _, result := range searchResults {
var find bool
if slices.Contains(loadRepoIDs, result.RepoID) {
find = true
}
if !find {
if !slices.Contains(loadRepoIDs, result.RepoID) {
loadRepoIDs = append(loadRepoIDs, result.RepoID)
}
}

View File

@@ -87,11 +87,7 @@ func CodeSearch(ctx *context.Context) {
loadRepoIDs := make([]int64, 0, len(searchResults))
for _, result := range searchResults {
var find bool
if slices.Contains(loadRepoIDs, result.RepoID) {
find = true
}
if !find {
if !slices.Contains(loadRepoIDs, result.RepoID) {
loadRepoIDs = append(loadRepoIDs, result.RepoID)
}
}