GetReleaseByID returns release with given ID.
(id int64)
| 240 | |
| 241 | // GetReleaseByID returns release with given ID. |
| 242 | func 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. |
no test coverage detected