MCPcopy Create free account
hub / github.com/gogs/gogs / GetReleaseByID

Function GetReleaseByID

internal/database/release.go:242–252  ·  view source on GitHub ↗

GetReleaseByID returns release with given ID.

(id int64)

Source from the content-addressed store, hash-verified

240
241// GetReleaseByID returns release with given ID.
242func GetReleaseByID(id int64) (*Release, error) {
243 r := new(Release)
244 has, err := x.Id(id).Get(r)
245 if err != nil {
246 return nil, err
247 } else if !has {
248 return nil, ErrReleaseNotExist{args: map[string]any{"releaseID": id}}
249 }
250
251 return r, r.LoadAttributes()
252}
253
254// GetPublishedReleasesByRepoID returns a list of published releases of repository.
255// If matches is not empty, only published releases in matches will be returned.

Callers 3

runWebFunction · 0.92
NewReleaseFunction · 0.85
DeleteReleaseOfRepoByIDFunction · 0.85

Calls 2

GetMethod · 0.65
LoadAttributesMethod · 0.45

Tested by

no test coverage detected