[#1718] linter: Resolve gocritic's elseif linter
See https://go-critic.com/overview#elseif for details. Change-Id: I8fd3edfacaeea2b0a83917575d545af7e7ab4d13 Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
d2114759aa
commit
8d499f03fe
4 changed files with 8 additions and 16 deletions
|
@ -655,11 +655,9 @@ func (ac *apeChecker) namespaceByOwner(ctx context.Context, owner *refs.OwnerID)
|
||||||
subject, err := ac.frostFSIDClient.GetSubject(ctx, addr)
|
subject, err := ac.frostFSIDClient.GetSubject(ctx, addr)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
namespace = subject.Namespace
|
namespace = subject.Namespace
|
||||||
} else {
|
} else if !strings.Contains(err.Error(), frostfsidcore.SubjectNotFoundErrorMessage) {
|
||||||
if !strings.Contains(err.Error(), frostfsidcore.SubjectNotFoundErrorMessage) {
|
|
||||||
return "", fmt.Errorf("get subject error: %w", err)
|
return "", fmt.Errorf("get subject error: %w", err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return namespace, nil
|
return namespace, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,11 +89,9 @@ func newTrustedTarget(ctx context.Context, prm *objectwriter.Params) (transforme
|
||||||
if !ownerObj.Equals(ownerSession) {
|
if !ownerObj.Equals(ownerSession) {
|
||||||
return nil, fmt.Errorf("session token is missing but object owner id (%s) is different from the default key (%s)", ownerObj, ownerSession)
|
return nil, fmt.Errorf("session token is missing but object owner id (%s) is different from the default key (%s)", ownerObj, ownerSession)
|
||||||
}
|
}
|
||||||
} else {
|
} else if !ownerObj.Equals(sessionInfo.Owner) {
|
||||||
if !ownerObj.Equals(sessionInfo.Owner) {
|
|
||||||
return nil, fmt.Errorf("different token issuer and object owner identifiers %s/%s", sessionInfo.Owner, ownerObj)
|
return nil, fmt.Errorf("different token issuer and object owner identifiers %s/%s", sessionInfo.Owner, ownerObj)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if prm.SignRequestPrivateKey == nil {
|
if prm.SignRequestPrivateKey == nil {
|
||||||
prm.SignRequestPrivateKey = key
|
prm.SignRequestPrivateKey = key
|
||||||
|
|
|
@ -61,11 +61,9 @@ func (g *ExpirationChecker) IsTombstoneAvailable(ctx context.Context, a oid.Addr
|
||||||
logs.TombstoneCouldNotGetTheTombstoneTheSource,
|
logs.TombstoneCouldNotGetTheTombstoneTheSource,
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
)
|
)
|
||||||
} else {
|
} else if ts != nil {
|
||||||
if ts != nil {
|
|
||||||
return g.handleTS(ctx, addrStr, ts, epoch)
|
return g.handleTS(ctx, addrStr, ts, epoch)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// requested tombstone not
|
// requested tombstone not
|
||||||
// found in the FrostFS network
|
// found in the FrostFS network
|
||||||
|
|
|
@ -436,11 +436,9 @@ func getSortedSubTree(ctx context.Context, srv TreeService_GetSubTreeServer, cid
|
||||||
}
|
}
|
||||||
if ms == nil {
|
if ms == nil {
|
||||||
ms = m.Items
|
ms = m.Items
|
||||||
} else {
|
} else if len(m.Items) != 1 {
|
||||||
if len(m.Items) != 1 {
|
|
||||||
return status.Error(codes.InvalidArgument, "multiple non-internal nodes provided")
|
return status.Error(codes.InvalidArgument, "multiple non-internal nodes provided")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
ts = append(ts, m.Time)
|
ts = append(ts, m.Time)
|
||||||
ps = append(ps, p)
|
ps = append(ps, p)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue