[#1454] Upgrade NeoFS SDK Go module with new IDs

Core changes:
 * avoid package-colliding variable naming
 * avoid using pointers to IDs where unnecessary
 * avoid using `idSDK` import alias pattern
 * use `EncodeToString` for protocol string calculation and `String` for
  printing

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-05-31 20:00:41 +03:00 committed by LeL
parent cc6209e8a0
commit 1c30414a6c
218 changed files with 2095 additions and 2521 deletions

View file

@ -1,14 +1,11 @@
package control
import (
"fmt"
rawclient "github.com/nspcc-dev/neofs-api-go/v2/rpc/client"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/common"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/commonflags"
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/key"
"github.com/nspcc-dev/neofs-node/pkg/services/control"
addressSDK "github.com/nspcc-dev/neofs-sdk-go/object/address"
"github.com/spf13/cobra"
)
@ -22,20 +19,10 @@ var dropObjectsCmd = &cobra.Command{
pk := key.Get(cmd)
dropObjectsList, _ := cmd.Flags().GetStringSlice(dropObjectsFlag)
binAddrList := make([][]byte, 0, len(dropObjectsList))
binAddrList := make([][]byte, len(dropObjectsList))
for i := range dropObjectsList {
a := addressSDK.NewAddress()
err := a.Parse(dropObjectsList[i])
if err != nil {
common.ExitOnErr(cmd, "", fmt.Errorf("could not parse address #%d: %w", i, err))
}
binAddr, err := a.Marshal()
common.ExitOnErr(cmd, "could not marshal the address: %w", err)
binAddrList = append(binAddrList, binAddr)
binAddrList[i] = []byte(dropObjectsList[i])
}
body := new(control.DropObjectsRequest_Body)