Overview
Use an unexported, zero-width, non-comparable field to prevent clients from comparing a struct
:
Another way is to define a nocmp
type and embed it into structs:
Use an unexported, zero-width, non-comparable field to prevent clients from comparing a struct
:
Another way is to define a nocmp
type and embed it into structs: