Get
should return a value RVV-A0006101 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 {
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")
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")
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")
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 {
Typically, functions with names prefixed with Get are supposed to return a value.
func GetData(n int) {
fmt.Println(10 - n)
}
func GetData(n int) int {
fmt.Println(10 - n)
return 10 - n
}