Skip to content

Commit

Permalink
Add coding guideline for optional fields.
Browse files Browse the repository at this point in the history
Specify to use pointers to represent optional fields. This is a follow up to: open-telemetry#9478.
  • Loading branch information
mackjmr committed Oct 3, 2024
1 parent 2d25853 commit 443fb34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ To guarantee backward-compatible behavior, all configuration packages should sup

Users should always initialize the config struct with this function and overwrite anything as needed.

### Optional Fields

Use pointers to represent optional fields in configuration to distinguish between unset values and zero values.

### Startup Error Handling

Verify configuration during startup and fail fast if the configuration is invalid.
Expand Down

0 comments on commit 443fb34

Please sign in to comment.