Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unmarshal ¶
Unmarshal unmarshals JSON data into the provided struct v while ensuring strict validation of the input.
It checks for any extra or missing fields in the JSON data that do not match the struct definition.
Unlike json.Unmarshal, Unmarshal is case-sensitive.
Example usage:
type MyStruct struct {
Field1 string `json:"field1"`
Field2 int `json:"field2"`
}
var obj MyStruct
err := Unmarshal([]byte(`{"field1": "value", "field2": 42}`), &obj)
if err != nil {
log.Fatal(err)
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.