Skip to content

Commit b4d995b

Browse files
committed
Fix typo
1 parent 228fb75 commit b4d995b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/testdata/errchkjson_omit_safe.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func JSONMarshalSaveStructWithUnexportedFieldsWithNoSafe() {
351351
func JSONMarshalSaveStructWithOmittedFieldsWithNoSafe() {
352352
var err error
353353

354-
var ommitInStruct struct {
354+
var omitInStruct struct {
355355
Bool bool // safe exported
356356

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

0 commit comments

Comments
 (0)