Skip to content

move most tzngio logic to zng StringOf() methods #1417

@mccanne

Description

@mccanne

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions