How to NOT marshal a field ? #675
-
It seems all upper-case fields will be marshal to toml, for example: type A struct {
Name string `toml: any magic to prevent the Name field being marshalled?`
// other fields...
} I need to access the |
Beta Was this translation helpful? Give feedback.
Answered by
moorereason
Nov 23, 2021
Replies: 1 comment 1 reply
-
With go-toml/v2 use this: // Field is ignored
Name string `toml:"-"` This use case is missing from the v2 godocs. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
aj3423
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With go-toml/v2 use this:
This use case is missing from the v2 godocs.