ErrorDelContext removes a value from the error's context. If the error has not been wrapped, it does nothing.
(err error, key string)
| 27 | // ErrorDelContext removes a value from the error's context. If the error has |
| 28 | // not been wrapped, it does nothing. |
| 29 | func DelContext(err error, key string) { |
| 30 | if e, ok := err.(withContext); ok { |
| 31 | e.Del(key) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | // ErrorContext returns the context map for an error if it is a wrappedError. |
| 36 | // If it is not a wrappedError it will return an empty map. |