Using string error comparisons was the only way to do this few years ago; and Go has a backwards compatibility promise.