cockroachdb / cockroachdb/errors
Errors returned from Join are incompatible with errors returned the standard lib's errors.Join
- Ngôn ngữ chính
- Go
- Star
- 2.5k
- Fork
- 74
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
The standard errors package uses the following example to extract the individual sub-errors from the result err of calling Join:
https://pkg.go.dev/errors#Join
`fmt.Println(err.(interface{ Unwrap() []error }).Unwrap())`
This is not possible with return values of Join:
`panic: interface conversion: *withstack.withStack is not interface { Unwrap() []error }: missing method Unwrap`
However the code needed to do the same is, unintuitively:
`fmt.Println(err.(interface{ Unwrap() error }).Unwrap().(interface{ Unwrap() []error }).Unwrap())`
Or is there a better way do it?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.