func (u *watch) findReleaseUpdate(installed string) (*github.RepositoryRelease, error) {
	rel, err := u.repo.GetLatestRelease()
	if err != nil {
		return nil, err
	}

	if rel.TagName == nil {
		return nil, errors.New("untagged release")
	}

	v1, err := version.NewVersion(installed)
	if err != nil {
		return nil, err
	}

	v2, err := version.NewVersion(*rel.TagName)
	if err != nil {
		return nil, err
	}

	if v1.LessThan(v2) {
		go u.fetchReleaseNotes(installed)
		return rel, nil
	}

	// no update
	return nil, nil
}
// findReleaseUpdate validates if updates are available
findReleaseUpdate validates if updates are available
// findReleaseUpdate validates if updates are available
func (u *watch) findReleaseUpdate(installed string) (*github.RepositoryRelease, error) {
	rel, err := u.repo.GetLatestRelease()
	if err != nil {
		return nil, err
	}
	if rel.TagName == nil {
		return nil, errors.New("untagged release")
	}
	v1, err := version.NewVersion(installed)
	if err != nil {
		return nil, err
	}
	v2, err := version.NewVersion(*rel.TagName)
	if err != nil {
		return nil, err
	}
	if v1.LessThan(v2) {
		go u.fetchReleaseNotes(installed)
		return rel, nil
	}
	return nil, nil
}
func ( u * watch ) findReleaseUpdate ( installed string ) ( * github . RepositoryRelease , error ) { rel , err := u . repo . GetLatestRelease ( ) if err != nil { return nil , err } if rel . TagName == nil { return nil , errors . New ( " " ) } v1 , err := version . NewVersion ( installed ) if err != nil { return nil , err } v2 , err := version . NewVersion ( * rel . TagName ) if err != nil { return nil , err } if v1 . LessThan ( v2 ) { go u . fetchReleaseNotes ( installed ) return rel , nil } return nil , nil }
findReleaseUpdate validates if updates are available
findReleaseUpdate validates if updates are available
// no update