Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
breml committed Nov 8, 2021
1 parent 228fb75 commit b4d995b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/testdata/errchkjson_omit_safe.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func JSONMarshalSaveStructWithUnexportedFieldsWithNoSafe() {
func JSONMarshalSaveStructWithOmittedFieldsWithNoSafe() {
var err error

var ommitInStruct struct {
var omitInStruct struct {
Bool bool // safe exported

F64 float64 `json:"-"` // unsafe exported but omitted
Expand Down Expand Up @@ -381,9 +381,9 @@ func JSONMarshalSaveStructWithOmittedFieldsWithNoSafe() {
UnsafePtr unsafe.Pointer `json:"-"` // invalid exported but omitted
MapStructStr map[structKey]string `json:"-"` // invalid exported but omitted
}
_ = ommitInStruct.MapStructStr[structKey{1}]
_, _ = json.Marshal(ommitInStruct) // ERROR "Error return value of `encoding/json.Marshal` is not checked"
_, err = json.Marshal(ommitInStruct) // struct containing unsafe but omitted, exported fields is safe, but omit-safe is set
_ = omitInStruct.MapStructStr[structKey{1}]
_, _ = json.Marshal(omitInStruct) // ERROR "Error return value of `encoding/json.Marshal` is not checked"
_, err = json.Marshal(omitInStruct) // struct containing unsafe but omitted, exported fields is safe, but omit-safe is set
_ = err
}

Expand Down

0 comments on commit b4d995b

Please sign in to comment.