Hello, I need my custom MarshalTOML method to be able to omit a field completely when it is set to nil but it does not appear to be possible. It must not return. nil, nil that is an error, there is no special error value for omitting a field, returning an empty buffer creates an invalid TOML:
# this is not valid
field_that_needs_to_be_omitted =
My type implements the Go 1.24 newly added IsZero() method but I guess that is something that is not supported in this library. That could be perhaps a solution.
Is there a solution? I do not have access to the script that encapsulates the type. Thanks.
Hello, I need my custom
MarshalTOMLmethod to be able to omit a field completely when it is set tonilbut it does not appear to be possible. It must not return.nil, nilthat is an error, there is no special error value for omitting a field, returning an empty buffer creates an invalid TOML:My type implements the Go 1.24 newly added
IsZero()method but I guess that is something that is not supported in this library. That could be perhaps a solution.Is there a solution? I do not have access to the script that encapsulates the type. Thanks.