Some MySQL Client errors allow Go errors to be wrapped. For example, the mysqlerrors.ClientBadTCPSocket, on timeout, it will include the underlaying Go error "i/o timeout". This, however, fails, because we use fmt.Sprintf and not fmt.Errorf when creating the message.
For example, the output when connecting to an unknown host:
unknown MySQL server host '127.0.0.40:33060' (%!w(*errors.errorString=&{i/o timeout})) [2005:HY000]
That should be:
unknown MySQL server host '127.0.0.40:33060' (i/o timeout) [2005:HY000]
Some MySQL Client errors allow Go errors to be wrapped. For example, the
mysqlerrors.ClientBadTCPSocket
, on timeout, it will include the underlaying Go error "i/o timeout". This, however, fails, because we usefmt.Sprintf
and notfmt.Errorf
when creating the message.For example, the output when connecting to an unknown host:
That should be:
Cod to reproduce: