go-test / deep

Golang deep variable equality test that returns human-readable differences
MIT License
743 stars 54 forks source link

Strings in struct fields are not compared correctly #59

Open klyubavsky opened 1 year ago

klyubavsky commented 1 year ago

As subj states looks like strings in struct fields are not compared:

        if diff := deep.Equal(struct{ foo string }{foo: "aa"}, struct{ foo string }{foo: "aab"}); diff != nil {
            t.Error(diff)
        }

will pass without error

daniel-nichter commented 1 year ago

Does it work if you set CompareUnexportedFields = true?

klyubavsky commented 1 year ago

Oh, sorry, didn't know that it is disabled by default :) Please resolve the issue. Thank you