You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -279,7 +279,7 @@ It is important to make sure your JSON expression returns a value that has a typ
279
279
280
280
### Model and DTO recommendations
281
281
282
-
- Use `json:",omitempty"` on all DTO fields.
282
+
- Use `json:",omitempty"` on all DTO fields. (or `json:",omitzero"` for struct fields like `time.Time`)
283
283
- *Note: using `omitempty` on slices will remove them from the json result if they are not nil and empty. There is currently no solution to this problem using the standard json package.*
284
284
- Don't include the foreign keys in the DTO.
285
285
- Use `*null.Time` from the [`gopkg.in/guregu/null.v4`](https://github.com/guregu/null) library instead of `sql.NullTime`.
0 commit comments