smartystreets / goconvey

Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.
http://smartystreets.github.io/goconvey/
Other
8.23k stars 554 forks source link

Why equalityMethodSpecification don't judge bType's Kind()? #657

Open kafkalm opened 2 years ago

kafkalm commented 2 years ago

in equal_method.go: line 38

func (this *equalityMethodSpecification) bothAreSameType() bool {
    this.aType = reflect.TypeOf(this.a)  
    if this.aType == nil {  
        return false  
    }  
    if this.aType.Kind() == reflect.Ptr {  
        this.aType = this.aType.Elem()  
    }  
    this.bType = reflect.TypeOf(this.b)  
    return this.aType == this.bType  
}

if bType is a pointer, it always return false