Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version constructor #179

Merged
merged 0 commits into from Aug 9, 2022
Merged

Conversation

kazhuravlev
Copy link
Contributor

@kazhuravlev kazhuravlev commented Aug 1, 2022

This New function is helpful for code like that

versions := []string{
  "v0.1.0",
  "v0.4.0",
}

maxVersion := semver.New(0, 0, 0, "", "")
for _, version := range versions{
  v, _ := semver.NewVersion(version)
  if v.GreaterThan(maxVersion) {
    maxVersion = v
  }
}

fmt.Println(maxVersion)

@kazhuravlev
Copy link
Contributor Author

@mattfarina I merge origin to my PR. Workflow green now. Please, re-run the workflow in this PR.

@mattfarina mattfarina merged commit bfa99d9 into Masterminds:master Aug 9, 2022
@mattfarina
Copy link
Member

I added a test for the New function and merged. Will be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants