-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
format slice and maps of float #399
Conversation
formatter.go
Outdated
|
||
if arr, ok := value.([]interface{}); ok { | ||
for k, v := range arr { | ||
arr[k] = f.formatValue(v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gavv this is a WIP PR, I want to discuss first before continue.
So, I was thinking to handle nested slice / maps of floats by doing recursive call.
Example: [[1.0, 2.0, 3.0]]
or ["a": [1.0, 2.0], "b": {"b1": [3.0, 4.0]}]
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense
Thanks for update, will review in upcoming days. Please fix tests and linter errors as reported by CI. |
77e35d3
to
7878c76
Compare
Hi, thanks for PR and sorry for delay. As you correctly mentioned, this patch breaks a lot of things and the implementation looks very strange, because it drops json.MarshalIndent, but does not provide a proper alternative. I was thinking how it could be implemented properly and I think I found a solution. I've created a new task for it, and will close current issue with regards to the new one. See here: #430 I think it makes sense to close this PR as well, because it seems we can't reuse anything from it (neither implementation nor tests). |
sure, will take a look. |
Closes #258