How to make a struct type incomparable #golang #tips #shorts



How to make a struct type incomparable #golang #tips #shorts

How to make a struct type incomparable #golang #tips #shorts

Sometimes, we want to avoid a custom struct type being used a map key types, then we can put a field of a non-exported zero-size incomparable type in a struct type to make the struct type incomparable.

#golang #tips #backend #backenddevelopment