forked from TrueCloudLab/frostfs-node
[#1437] node: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
6921a89061
commit
7429553266
209 changed files with 1068 additions and 1036 deletions
|
@ -1,6 +1,7 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
|
||||
|
@ -12,7 +13,7 @@ import (
|
|||
// along with signature and session token.
|
||||
//
|
||||
// Returns error if container ID is nil.
|
||||
func Delete(c *Client, witness core.RemovalWitness) error {
|
||||
func Delete(ctx context.Context, c *Client, witness core.RemovalWitness) error {
|
||||
binCnr := make([]byte, sha256.Size)
|
||||
witness.ContainerID.Encode(binCnr)
|
||||
|
||||
|
@ -26,7 +27,7 @@ func Delete(c *Client, witness core.RemovalWitness) error {
|
|||
prm.SetToken(tok.Marshal())
|
||||
}
|
||||
|
||||
_, err := c.Delete(prm)
|
||||
_, err := c.Delete(ctx, prm)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -67,7 +68,7 @@ func (d *DeletePrm) SetKey(key []byte) {
|
|||
// the removal to interrupt.
|
||||
//
|
||||
// If TryNotary is provided, calls notary contract.
|
||||
func (c *Client) Delete(p DeletePrm) (uint32, error) {
|
||||
func (c *Client) Delete(ctx context.Context, p DeletePrm) (uint32, error) {
|
||||
if len(p.signature) == 0 && !p.IsControl() {
|
||||
return 0, errNilArgument
|
||||
}
|
||||
|
@ -77,7 +78,7 @@ func (c *Client) Delete(p DeletePrm) (uint32, error) {
|
|||
prm.SetArgs(p.cnr, p.signature, p.key, p.token)
|
||||
prm.InvokePrmOptional = p.InvokePrmOptional
|
||||
|
||||
res, err := c.client.Invoke(prm)
|
||||
res, err := c.client.Invoke(ctx, prm)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("could not invoke method (%s): %w", deleteMethod, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue