JSONFieldNames supports accessing protocol buffer fields by json-name. Enabling JSON field name support will create a copy of the types.Registry with fields indexed by JSON name, and whether JSON name or Proto-style names are supported will be inferred from the AST extensions metadata.
(enabled bool)
| 440 | // by JSON name, and whether JSON name or Proto-style names are supported will be inferred from |
| 441 | // the AST extensions metadata. |
| 442 | func JSONFieldNames(enabled bool) EnvOption { |
| 443 | return features(featureJSONFieldNames, enabled) |
| 444 | } |
| 445 | |
| 446 | // ProgramOption is a functional interface for configuring evaluation bindings and behaviors. |
| 447 | type ProgramOption func(p *prog) (*prog, error) |