closes #1514 hi! I had the same problem as #1514 and I wanted to fix it, I found When asserting *crypto/rsa.PublicKey, using the typ attribute of node to get an nil rtype, resulting in the assertion result being nok This code contains the same problem ```go package main import ( "log" "crypto/rsa" ) func main() { var pKey interface{} = &rsa.PublicKey{} if _, ok := pKey.(*rsa.PublicKey); ok { log.Println("ok") } else { log.Println("nok") } } ``` So I submitted this Pull Request, hope it will be merged
17 lines
198 B
Go
17 lines
198 B
Go
package main
|
|
|
|
import "crypto/rsa"
|
|
|
|
func main() {
|
|
var pKey interface{} = &rsa.PublicKey{}
|
|
|
|
if _, ok := pKey.(*rsa.PublicKey); ok {
|
|
println("ok")
|
|
} else {
|
|
println("nok")
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// ok
|