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
{{ message }}
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This test sets (first false) ZeroNil to false (thus differing nil from []string{}), and subsequently expects the hashes to be different (second false).
Changing the second false to true (thereby expecting same hashes from the two tests) passes the test, which obviously shouldn't be the case.
No matter the setting of the IsZero option, nil and empty initialized slices are always considered the same.
Drawing from the
TestHash_equalNiltest function, adding this case will break tests:{ Test{ Str: nil, Int: nil, Map: nil, Slice: nil, }, Test{ Str: nil, Int: nil, Map: nil, Slice: make([]string, 0), }, false, false, },This test sets (first
false)ZeroNiltofalse(thus differingnilfrom[]string{}), and subsequently expects the hashes to be different (secondfalse).Changing the second
falsetotrue(thereby expecting same hashes from the two tests) passes the test, which obviously shouldn't be the case.