revoly
Re:Compile-time safety for enumerations in Go
on Friday September 29, 2023 @11:16AM (#37705494)
I don't think the solution is trying to cover this. If a user does type conversion then usually they know what they are doing. It's like going out of the way. The solution is to just hide a type behind an interface to be explicit about it and to avoid the error that would have gone unnoticed otherwise.