[#xx] Make all error status receivers pointers #135
No reviewers
TrueCloudLab/storage-services-developers
TrueCloudLab/storage-services-committers
Labels
No labels
P0
P1
P2
P3
good first issue
pool
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#135
Loading…
Reference in a new issue
No description provided.
Delete branch "ale64bit/frostfs-sdk-go:fix/status-error-pointer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See TrueCloudLab/frostfs-node#481
Signed-off-by: Alejandro Lopez a.lopez@yadro.com
9073aaa146
tofe35170789
[#xx] Make all error status receivers pointersto WIP: [#xx] Make all error status receivers pointersWIP: [#xx] Make all error status receivers pointersto [#xx] Make all error status receivers pointersNice👍 We really need these changes
@ -9,4 +9,1 @@
// unwraps err using errors.Unwrap and returns the result.
func unwrapErr(err error) error {
for e := errors.Unwrap(err); e != nil; e = errors.Unwrap(err) {
Why did you remove this logic?
because it's not used and it's not exported
Ok, why did we not use
unwrapErr
inIsErr...()
anymore?It was a deliberate decision and I don't see how this change is related to "make all status receivers pointers".
See for the discussion when this was introduced https://github.com/nspcc-dev/neofs-sdk-go/pull/279#discussion_r907279144
discussed offline
@ -28,2 +13,2 @@
return true
}
target := new(apistatus.ContainerNotFound)
return errors.As(err, &target)
Can we use
errors.Is
here?No.
errors.Is
checks equality.errors.As
checks assignability.Is
can be overridden (https://cs.opensource.google/go/go/+/refs/tags/go1.20.7:src/errors/wrap.go;l=53 ) and the variable we use to compare can be shared), so it looks somewhat more optimal.But I agree it needs some support in code.
fe35170789
toc6bac9c22b