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
package asserttest
import (
"other"
"github.com/bmizerany/assert"
"testing"
)
func TestBreakAssert2(t *testing.T) {
a := new(other.Other)
a.Outer = 2
b := new(other.Other)
b.Outer = 4
assert.Equal(t, a, b)
}
other/other.go
package other
type Other struct {
Outer int
inner int
}
Both these snippets panic like so
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method [recovered]
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method
etc ...
The text was updated successfully, but these errors were encountered:
Given two unequal structs from another package with unexported fields assert.Equal will panic.
Example with time package
Example with an invented struct
asserttest/assert_test.go
other/other.go
Both these snippets panic like so
The text was updated successfully, but these errors were encountered: