Skip to content

State info can handle versions#1201

Merged
MDrakos merged 5 commits intomasterfrom
info-versions-176192863
Jan 8, 2021
Merged

State info can handle versions#1201
MDrakos merged 5 commits intomasterfrom
info-versions-176192863

Conversation

@MDrakos
Copy link
Member

@MDrakos MDrakos commented Jan 8, 2021

@MDrakos MDrakos requested a review from Naatan January 8, 2021 19:37
Copy link
Contributor

@Naatan Naatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just some minor stuff.

if version != "" {
ingredientVersion, err = specificIngredientVersion(pkg.Ingredient.IngredientID, version)
if err != nil {
return locale.NewInputError("info_err_version_not_found", "Could not find version {{.V0}} for package {{.V1}}", version, pkgName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be wrapping the error

}

for _, iv := range ingredientVersions {
if *iv.Version == version {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a nil check

}
}

return nil, locale.NewError("err_no_ingredient_version_found", "No ingredient version found")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be a input error

@MDrakos MDrakos merged commit 478b405 into master Jan 8, 2021
@MDrakos MDrakos deleted the info-versions-176192863 branch January 8, 2021 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants