How slow is using type assertions / type switches in Go, as a method of run-time type discovery?
I\'ve heard that in C/C++ for example, discovering types at run time
I run bench example by @siritinga in my laptop (go1.7.3 linux/amd64), got this result:
$ go test -bench . BenchmarkIntmethod-4 2000000000 1.99 ns/op BenchmarkInterface-4 1000000000 2.30 ns/op BenchmarkTypeSwitch-4 2000000000 1.80 ns/op BenchmarkTypeAssertion-4 2000000000 1.67 ns/op