cors
cors copied to clipboard
internal/origin: TestMaxUint16 can be replaced with a compile-time assertion
TestMaxUint16 can be replaced by:
// If this doesn't compile we have a mismatch of maxUint16 and math.MaxUint16
var _ = [1]int{}[maxUint16-math.MaxUint16]
Explanation: the difference between maxUint16 and math.MaxUint16 must be 0.
Promising! I'll try that. Not that the test in question is prohibitively slow (far from it), but if more things can be checked at compile time, I'm all for it.