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

feat(angle): implement JSON interface #168

Merged
merged 1 commit into from
Jan 16, 2024
Merged

feat(angle): implement JSON interface #168

merged 1 commit into from
Jan 16, 2024

Conversation

hug-dev
Copy link
Member

@hug-dev hug-dev commented Jan 15, 2024

If the methods are not implemented, the test fails with:

--- FAIL: TestAngle_JSON (0.00s)
    angle_test.go:110: assertion failed: error is not nil: json: cannot unmarshal number into Go struct field JSONStruct.TheImportantAngle of type unit.Angle

@hug-dev hug-dev requested a review from a team as a code owner January 15, 2024 16:41
@hug-dev hug-dev requested a review from tvkn January 15, 2024 16:45
Copy link
Contributor

@tvkn tvkn left a comment

Choose a reason for hiding this comment

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

Sweet!

angle.go Show resolved Hide resolved
Copy link
Member

@maxekman maxekman left a comment

Choose a reason for hiding this comment

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

LGTM, but consider the comment by @tvkn.

@hug-dev hug-dev merged commit 919092a into master Jan 16, 2024
1 check passed
@hug-dev hug-dev deleted the json branch January 16, 2024 08:40
return nil
}

func (a *Angle) MarshalJSON() ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missed the matching comment here too :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Since those are not meant to be called directly, I did not think this was very important. Can add one more PR either

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.

3 participants