Open elezar opened 4 months ago
Your two example's in the description are the same .. I think you wanted one of them to check euqility instead of using errors.Is()
.
That said -- what will happen if someone does do err == nvml.ERROR_NOT_SUPPORTED
? Will it be false
even when errors.Is(err, nvml.ERROR_NOT_SUPPORTED)
would be true
?
These changes move from using
nvml.Return
values to using native Golangerror
values, making code more idiomatic.Note that this requires that
error.Is
is used instead of checking for equality in the returned value.For example:
would become: