Skip to content

Commit bd57468

Browse files
committed
docs: correct README code for optional
1 parent ad2ddd0 commit bd57468

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ And can be embedded in structs, for instance with the following definition:
1414
obj := struct {
1515
// RequiredID is a required, nullable field
1616
RequiredID nullable.Nullable[int] `json:"id"`
17-
// RequiredID is an optional, nullable field
18-
OptionalString *nullable.Nullable[string] `json:"optionalString,omitempty"`
17+
// OptionalString is an optional, nullable field
18+
// NOTE that no pointer is required, only `omiempty`
19+
OptionalString nullable.Nullable[string] `json:"optionalString,omitempty"`
1920
}{}
2021
```
2122

0 commit comments

Comments
 (0)