Functions prefixed with Get should return a value RVV-A0006
Anti-pattern
Major
2 years ago2 years old
function 'GetContents' seems to be a getter but it does not return any result
101	return content, nil
102}
103
104func GetContents(c *context.APIContext) {105	repoPath := repoutil.RepositoryPath(c.Params(":username"), c.Params(":reponame"))
106	gitRepo, err := git.Open(repoPath)
107	if err != nil {
function 'GetMilestone' seems to be a getter but it does not return any result
28	c.JSONSuccess(&apiMilestones)
29}
30
31func GetMilestone(c *context.APIContext) {32	milestone, err := database.GetMilestoneByRepoID(c.Repo.Repository.ID, c.ParamsInt64(":id"))
33	if err != nil {
34		c.NotFoundOrError(err, "get milestone by repository ID")
function 'GetLabel' seems to be a getter but it does not return any result
28	c.JSONSuccess(&apiLabels)
29}
30
31func GetLabel(c *context.APIContext) {32	var label *database.Label
33	var err error
34	idStr := c.Params(":id")
function 'GetDeployKey' seems to be a getter but it does not return any result
 42}
 43
 44// https://github.com/gogs/go-gogs-client/wiki/Repositories-Deploy-Keys#get-a-deploy-key
 45func GetDeployKey(c *context.APIContext) { 46	key, err := database.GetDeployKeyByID(c.ParamsInt64(":id"))
 47	if err != nil {
 48		c.NotFoundOrError(err, "get deploy key by ID")
function 'GetArchive' seems to be a getter but it does not return any result
34	}
35}
36
37func GetArchive(c *context.APIContext) {38	repoPath := database.RepoPath(c.Params(":username"), c.Params(":reponame"))
39	gitRepo, err := git.Open(repoPath)
40	if err != nil {