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

fix: Distinct between float and integer when printing YAML format #89

Merged

Conversation

nieomylnieja
Copy link
Contributor

Motivation

Since version v0.0.97 a regression has occurred where we stopped printing integer values correctly. Instead of printing them as integers we always printed every number as a float.
The main culprit of this regression was a switch to SDK-based parsing methods which utilized a new YAML library.

Related changes

Fixed in: nobl9/nobl9-go#347.

Testing

Run sloctl get on objects which operate on ints and floats like Alert Policy or Agent.

Release Notes

Fixed regression in printing YAML output for sloctl get commands which caused integers to be displayed as floats (ex. 1.0 instead of 1). The regression was introduced in version v0.0.97.

@n9-machine-user n9-machine-user added bug Something isn't working go patch labels Mar 28, 2024
Copy link
Contributor

@dawidwisn dawidwisn left a comment

Choose a reason for hiding this comment

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

It works for me!

@nieomylnieja nieomylnieja merged commit 30691e5 into main Mar 29, 2024
5 checks passed
@nieomylnieja nieomylnieja deleted the decode-json-object-to-number-and-add-object-print-functions branch March 29, 2024 11:14
BSski pushed a commit that referenced this pull request May 7, 2024
## Motivation

Since version v0.0.97 a regression has occurred where we stopped
printing integer values correctly. Instead of printing them as integers
we always printed every number as a float.
The main culprit of this regression was a switch to SDK-based parsing
methods which utilized a new YAML library.

## Related changes

Fixed in: nobl9/nobl9-go#347.

## Testing

Run `sloctl get` on objects which operate on ints and floats like Alert
Policy or Agent.

## Release Notes

Fixed regression in printing YAML output for `sloctl get` commands which
caused integers to be displayed as floats (ex. `1.0` instead of `1`).
The regression was introduced in version `v0.0.97`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working go patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants