repo.GetOwner should be repo.LoadOwner #10292

Closed
opened 2025-11-02 09:03:23 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @yp05327 on GitHub (Feb 18, 2023).

Feature Description

I think the GetOwner here should be LoadOwner. Get means return something and Load means something is nil, we need to load it.
This func dosen't return anything, but the description of this func says GetOwner returns the repository owner
8bba7e30b2/models/repo/repo.go (L376-L384)

In other places, the functions which do samething are called LoadOwner
8bba7e30b2/models/project/project.go (L110-L116)
8bba7e30b2/models/admin/task.go (L95-L112)

Screenshots

No response

Originally created by @yp05327 on GitHub (Feb 18, 2023). ### Feature Description I think the `GetOwner` here should be `LoadOwner`. `Get` means return something and `Load` means something is `nil`, we need to load it. This func dosen't return anything, but the description of this func says `GetOwner returns the repository owner ` https://github.com/go-gitea/gitea/blob/8bba7e30b2833d750af0345b75a3998785ef55ef/models/repo/repo.go#L376-L384 In other places, the functions which do samething are called `LoadOwner` https://github.com/go-gitea/gitea/blob/8bba7e30b2833d750af0345b75a3998785ef55ef/models/project/project.go#L110-L116 https://github.com/go-gitea/gitea/blob/8bba7e30b2833d750af0345b75a3998785ef55ef/models/admin/task.go#L95-L112 ### Screenshots _No response_
GiteaMirror added the type/refactoring label 2025-11-02 09:03:23 -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#10292