// GetRelease returns the specified release or ErrNotFound.
GetRelease returns the specified release or ErrNotFound.
// GetRelease returns the specified release or ErrNotFound .
func (s *githubStore) GetRelease(version string) (*update.Release, error) {
	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	defer cancel()
	gh := s.client(ctx)
	r, res, err := gh.Repositories.GetReleaseByTag(ctx, s.Owner, s.Repo, "v"+version)
	if res.StatusCode == 404 {
		return nil, update.ErrNotFound
	}
	if err != nil {
		return nil, err
	}
	return githubRelease(r), nil
}
func ( s * githubStore ) GetRelease ( version string ) ( * update . Release , error ) { ctx , cancel := context . WithTimeout ( context . Background ( ) , 5 * time . Second ) defer cancel ( ) gh := s . client ( ctx ) r , res , err := gh . Repositories . GetReleaseByTag ( ctx , s . Owner , s . Repo , " " + version ) if res . StatusCode == 404 { return nil , update . ErrNotFound } if err != nil { return nil , err } return githubRelease ( r ) , nil }
GetRelease returns the specified release or ErrNotFound.
GetRelease returns the specified release or ErrNotFound .