Skip to content

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.

2 participants