Y
Hacker News
new
|
ask
|
show
|
jobs
by
assbuttbuttass
1248 days ago
It's true, but you'd never really write code like this
https://go.dev/play/p/r9NkQb6bQTx
1 comments
erik_seaberg
1248 days ago
The problem also affects structs that happen to have a private map or cache or callback anywhere within.
https://go.dev/play/p/uP-vjpvuhku
link
preseinger
1247 days ago
Obviously `interface{}` values are not comparable?
link
erik_seaberg
1247 days ago
The comparison is explicitly allowed in the language spec, there’s no warning for doing it, and it often works depending on the types. It’s a data-dependent runtime error, which is usually hard to guarantee test coverage for.
link
https://go.dev/play/p/uP-vjpvuhku