bcicen / go-units

Go library for converting between various units of measurement
MIT License
82 stars 21 forks source link

JsonMarshall #24

Open clausMeko opened 1 year ago

clausMeko commented 1 year ago

Hey guys,

units.Unit has no native JsonMarshall method. I.e. when creating json from it those fields remain empty.

What is your recommended approach to that for us users?

Cheers, Claus

Leila-Codes commented 7 months ago

What would be the preferred JSON output? I might suggest that a PR be added that adds the JsonMarshaller wraps over the existing String() methods (as output to console.)

Would this be a worthwhile solution?