colorjson icon indicating copy to clipboard operation
colorjson copied to clipboard

Added support for ints, uints and float32

Open bt opened this issue 5 years ago • 6 comments

I added support for various int and uint types, as well as float32.

I understand that your library was targeting unmarshalled JSON structs, so this might not be in scope. I am using colorjson to pretty-print my structs for debugging purposes and noticed that since these types aren't implemented, they return as an empty string in the output.

Also, unsure if there's a better way to implement this; Golang doesn't seem to like grouping int/uint types together and then type casting, so I have to make a case for each. The other option would of course be to use reflect but it's quite a bit slower.

bt avatar Mar 20 '19 07:03 bt

Could this be merged @TylerBrock ?

gavincarr avatar Jan 25 '22 07:01 gavincarr

Ah yeah, sorry for the delay. I might be able to spend some time on PRs this week. Stay tuned.

TylerBrock avatar Jan 26 '22 02:01 TylerBrock

It doesn't look like we can merge this one as is because of the included go.mod.

I'm also on the fence for including this functionality as the library is meant to print unmarshalled json... I'll have to think on that a bit.

TylerBrock avatar Jan 26 '22 02:01 TylerBrock

It doesn't look like we can merge this one as is because of the included go.mod.

I'm also on the fence for including this functionality as the library is meant to print unmarshalled json... I'll have to think on that a bit.

Understood, hence I mentioned in my PR.

Let me know if you'd like me to remove the go.mod for the merge, if you'd accept.

bt avatar Jan 27 '22 03:01 bt

Yes please do, lets start there and review what’s left.

On Wed, Jan 26, 2022 at 10:51 PM Bertram Truong @.***> wrote:

It doesn't look like we can merge this one as is because of the included go.mod.

I'm also on the fence for including this functionality as the library is meant to print unmarshalled json... I'll have to think on that a bit.

Understood, hence I mentioned in my PR.

Let me know if you'd like me to remove the go.mod for the merge, if you'd accept.

— Reply to this email directly, view it on GitHub https://github.com/TylerBrock/colorjson/pull/2#issuecomment-1022821996, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACERZYUYEDFRMNI6FR6RYLUYC6NPANCNFSM4G72YEBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

--

-Tyler

TylerBrock avatar Jan 27 '22 12:01 TylerBrock

Yes please do, lets start there and review what’s left. On Wed, Jan 26, 2022 at 10:51 PM Bertram Truong @.> wrote: It doesn't look like we can merge this one as is because of the included go.mod. I'm also on the fence for including this functionality as the library is meant to print unmarshalled json... I'll have to think on that a bit. Understood, hence I mentioned in my PR. Let me know if you'd like me to remove the go.mod for the merge, if you'd accept. — Reply to this email directly, view it on GitHub <#2 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACERZYUYEDFRMNI6FR6RYLUYC6NPANCNFSM4G72YEBQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.>

-Tyler

Done! The go.mod file has been removed.

Let me know if there's any further requirements for the PR and I'll see what I can do.

bt avatar Jan 28 '22 01:01 bt