Skip to content

Commit

Permalink
docs: correct README code for optional
Browse files Browse the repository at this point in the history
  • Loading branch information
jamietanna committed Jan 10, 2024
1 parent ad2ddd0 commit bd57468
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ And can be embedded in structs, for instance with the following definition:
obj := struct {
// RequiredID is a required, nullable field
RequiredID nullable.Nullable[int] `json:"id"`
// RequiredID is an optional, nullable field
OptionalString *nullable.Nullable[string] `json:"optionalString,omitempty"`
// OptionalString is an optional, nullable field
// NOTE that no pointer is required, only `omiempty`
OptionalString nullable.Nullable[string] `json:"optionalString,omitempty"`
}{}
```

Expand Down

0 comments on commit bd57468

Please sign in to comment.