Skip to content

Remove blank arrays and false boolean variables from serialised output #177

@pavel-odintsov

Description

@pavel-odintsov

Hello!

First of all, I would like to say thank you for your brilliant library!

Right now I'm working on space optimisation of our data.

We have a pretty big number of false variables and blank arrays in output. I'm looking for ways to suppress them from generated message pack.

For example, we have the following structure:

type MyData struct {
  Name string
  Options []string
  SomeBoolValue bool
  AnotherBoolVariable bool
} 

And then we have the following structure:

obj.Name = "xyz"
obj.Options = []string{}
obj.SomeBoolVariable = false
obj.AnotherBoolVariable = true

And I would like to have in generated message pack only:

Name: "xyz"
obj.AnotherBoolVariable = true

And skip blank arrays / false variables.

How could I achieve this goal?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions