Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type User ¶
type User struct {
// Updated JSON tags to camelCase
Alias string `json:"alias,omitempty"`
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
}
func (User) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
REFACTOR: This now has a VALUE RECEIVER (no *). This makes the marshaling robust and linter-friendly.
func (*User) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. This remains a POINTER RECEIVER (*u), which is correct because it needs to modify the struct it's called on.
Click to show internal directories.
Click to hide internal directories.