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

JSON support and BumpVersion #9

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

JSON support and BumpVersion #9

wants to merge 10 commits into from

Conversation

burl
Copy link

@burl burl commented Nov 5, 2015

JSON Marshal/UnMarshal support added.

BumpVersion() added, which allows one of Major, Minor or Patch part to be incremented.

@aryszka
Copy link

aryszka commented Jan 19, 2017

i was checking if a feature request for version incrementing already exists and found this PR. I would be happy to see the bump feature, if it returned a new object, leaving the original unchanged.

@hashicorp-cla
Copy link

hashicorp-cla commented Dec 6, 2019

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes


0 out of 2 committers have signed the CLA.

  • Burl Nyswonger
  • burl

Burl Nyswonger seems not to be a GitHub user.
You need a GitHub account to be able to sign the CLA. If you already have a GitHub account, please add the email address used for this commit to your account.

Have you signed the CLA already but the status is still pending? Recheck it.

Comment on lines +171 to +177
err = json.Unmarshal(data, &constraintStr)
if err != nil {
return
}

nc, err = NewConstraint(constraintStr)
if err != nil {

Choose a reason for hiding this comment

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

Suggested change
err = json.Unmarshal(data, &constraintStr)
if err != nil {
return
}
nc, err = NewConstraint(constraintStr)
if err != nil {
if err = json.Unmarshal(data, &constraintStr); err != nil {
return
}
if nc, err = NewConstraint(constraintStr); err != nil {

Comment on lines +200 to +201
nc, err = NewConstraint(constraintStr)
if err != nil {

Choose a reason for hiding this comment

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

Suggested change
nc, err = NewConstraint(constraintStr)
if err != nil {
if nc, err = NewConstraint(constraintStr); err != nil {

Comment on lines +186 to +188
func (c *Constraints) MarshalYAML() (str interface{}, err error) {
str = c.String()
return

Choose a reason for hiding this comment

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

Suggested change
func (c *Constraints) MarshalYAML() (str interface{}, err error) {
str = c.String()
return
func (c *Constraints) MarshalYAML() (interface{}, error) {
return c.String(), nil

Comment on lines +290 to +296
err = json.Unmarshal(data, &verStr)
if err != nil {
return
}

nv, err = NewVersion(verStr)
if err != nil {

Choose a reason for hiding this comment

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

Suggested change
err = json.Unmarshal(data, &verStr)
if err != nil {
return
}
nv, err = NewVersion(verStr)
if err != nil {
if err = json.Unmarshal(data, &verStr); err != nil {
return
}
if nv, err = NewVersion(verStr); err != nil {

Comment on lines +305 to +308
func (v *Version) MarshalYAML() (str interface{}, err error) {
str = v.String()
return
}

Choose a reason for hiding this comment

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

Suggested change
func (v *Version) MarshalYAML() (str interface{}, err error) {
str = v.String()
return
}
func (v *Version) MarshalYAML() (interface{}, error) {
return v.String(), nil
}

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.

4 participants