mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
refactor: remove redundant err declarations (#32381)
This commit is contained in:
@ -202,7 +202,6 @@ func Search(ctx *context.APIContext) {
|
||||
}
|
||||
}
|
||||
|
||||
var err error
|
||||
repos, count, err := repo_model.SearchRepository(ctx, opts)
|
||||
if err != nil {
|
||||
ctx.JSON(http.StatusInternalServerError, api.SearchError{
|
||||
|
@ -111,7 +111,6 @@ func ListMyRepos(ctx *context.APIContext) {
|
||||
IncludeDescription: true,
|
||||
}
|
||||
|
||||
var err error
|
||||
repos, count, err := repo_model.SearchRepository(ctx, opts)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "SearchRepository", err)
|
||||
|
@ -276,7 +276,6 @@ func ViewPost(ctx *context_module.Context) {
|
||||
if validCursor {
|
||||
length := step.LogLength - cursor.Cursor
|
||||
offset := task.LogIndexes[index]
|
||||
var err error
|
||||
logRows, err := actions.ReadLogs(ctx, task.LogInStorage, task.LogFilename, offset, length)
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, err.Error())
|
||||
|
@ -94,7 +94,6 @@ func ActivityAuthors(ctx *context.Context) {
|
||||
timeFrom = timeUntil.Add(-time.Hour * 168)
|
||||
}
|
||||
|
||||
var err error
|
||||
authors, err := activities_model.GetActivityStatsTopAuthors(ctx, ctx.Repo.Repository, timeFrom, 10)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetActivityStatsTopAuthors", err)
|
||||
|
@ -143,7 +143,6 @@ func findReadmeFileInEntries(ctx *context.Context, entries []*git.TreeEntry, try
|
||||
// this should be impossible; if subTreeEntry exists so should this.
|
||||
continue
|
||||
}
|
||||
var err error
|
||||
childEntries, err := subTree.ListEntries()
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
|
Reference in New Issue
Block a user