-
Notifications
You must be signed in to change notification settings - Fork 70
Description
There is redundancy betweem the StringOf() methods that format tzng strings from zng values and the code in the tzng writer. With a small bit of code movement, the tzngio writer could be simplified by referring to StringOf() for all types. If performance is deemed an issue (I don't think we can much about tzng perf compared to zng and zst), we could change StringOf to take a builder.
<bikeshed>
While we're at it here, I find the StringOf() method name in the zng.Type interface confusing. Ask someone what the difference between a String() and a StringOf() is? I think Format() would be more aligned with the semantics. After all, the method even takes an output format type as a parameter!
</bikeshed>
Also, StringOf/Format() should return an error instead of embedding "ERR" is of the places.