370 }
371
372 if _, err = x.Id(rel.ID).Delete(new(Release)); err != nil {
373 return fmt.Errorf("Delete: %v", err)374 }
375
376 return nil
334 }
335
336 if err = sess.Commit(); err != nil {
337 return fmt.Errorf("Commit: %v", err)338 }
339
340 if !isPublish {
236
237 r := &Release{RepoID: repoID, LowerTagName: strings.ToLower(tagName)}
238 if _, err = x.Get(r); err != nil {
239 return nil, fmt.Errorf("Get: %v", err)240 }
241
242 return r, r.LoadAttributes()
191 }
192
193 if err = sess.Commit(); err != nil {
194 return fmt.Errorf("Commit: %v", err)195 }
196
197 // Only send webhook when actually published, skip drafts
181 }
182
183 if _, err = sess.Insert(r); err != nil {
184 return fmt.Errorf("Insert: %v", err)185 }
186
187 if len(uuids) > 0 {
Error strings follow a set of guidelines to ensure uniformity and good composability.
Quoting Go Code Review Comments:
Error strings should not be capitalized (unless beginning with
proper nouns or acronyms) or end with punctuation, since they are
usually printed following other context. That is, use
fmt.Errorf("something bad") not fmt.Errorf("Something bad"), so
that log.Printf("Reading %s: %v", filename, err) formats without a
spurious capital letter mid-message.