96 return c.User.ID
97}
98
99// HasError returns true if error occurs in form validation.100func (c *Context) HasApiError() bool {
101 hasErr, ok := c.Data["HasError"]
102 if !ok {
91 return r.loadAttributes(x)
92}
93
94// This method assumes some fields assigned with values: 95// Required - Publisher
96func (r *Release) APIFormat() *api.Release {
97 return &api.Release{
164 return m, nil
165}
166
167// GetWebhookByRepoID returns the milestone in a repository.168func GetMilestoneByRepoID(repoID, id int64) (*Milestone, error) {
169 return getMilestoneByRepoID(x, repoID, id)
170}
96 c.JSON(http.StatusCreated, convert.ToDeployKey(apiLink, key))
97}
98
99// https://github.com/gogs/go-gogs-client/wiki/Repositories-Deploy-Keys#remove-a-deploy-key100func DeleteDeploykey(c *context.APIContext) {
101 if err := database.DeleteDeployKey(c.User, c.ParamsInt64(":id")); err != nil {
102 if database.IsErrKeyAccessDenied(err) {
77 }
78}
79
80// https://github.com/gogs/go-gogs-client/wiki/Repositories-Deploy-Keys#add-a-new-deploy-key 81func CreateDeployKey(c *context.APIContext, form api.CreateKeyOption) {
82 content, err := database.CheckPublicKeyString(form.Key)
83 if err != nil {
Doc comments work best as complete sentences, which allow a wide variety of automated presentations. The first sentence should be a one-sentence summary that starts with the name being declared.
If every doc comment begins with the name of the item it describes, you can use the doc subcommand of the go tool and run the output through grep.
See https://golang.org/doc/effective_go.html#commentary for more information on how to write good documentation.
package main
// This function tries to summon a cybernetically enhanced duck
func SummonDucks() {
}
package main
// SummonDucks tries to summon a cybernetically enhanced duck
func SummonDucks() {
}