Documentation ¶
Overview ¶
Package private implements field redaction in maps and structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Redact ¶
Redact returns a copy of val with any fields or map elements that have been marked as private removed. Fields can be marked as private by including a sibling string- or []string-valued field or element with the name of the private field. The names of fields are interpreted through the tag parameter if present. For example if tag is "json", the `json:"<name>"` name would be used, falling back to the field name if not present. The tag parameter is ignored for map values.
If a field has a `private:...` tag, its tag value will also be used to determine the list of private fields. If the private tag is empty, `private:""`, the fields with the tag will be marked as private. Otherwise the comma-separated list of names with be used. The list may refer to its own field.
Types ¶
This section is empty.