IsUnsupported returns true if err is the result of trying an unsupported operation. It is equivalent to finding the first error in err's chain that implements type unsupported interface { Unsupported() bool } and then calling the Unsupported() method.
(err error)
| 31 | // |
| 32 | // and then calling the Unsupported() method. |
| 33 | func IsUnsupported(err error) bool { |
| 34 | var u interface { |
| 35 | Unsupported() bool |
| 36 | } |
| 37 | return errors.As(err, &u) && u.Unsupported() |
| 38 | } |