[#722] neofs-adm: Replace path with filepath package

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-04-08 17:40:51 +03:00 committed by LeL
parent 5bd6624eb6
commit b685af487f

View file

@ -4,7 +4,6 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"os" "os"
"path"
"path/filepath" "path/filepath"
"github.com/nspcc-dev/neo-go/cli/input" "github.com/nspcc-dev/neo-go/cli/input"
@ -27,7 +26,7 @@ func initializeContractWallet(walletDir string) (*wallet.Wallet, error) {
return nil, err return nil, err
} }
w, err := wallet.NewWallet(path.Join(walletDir, contractWalletFilename)) w, err := wallet.NewWallet(filepath.Join(walletDir, contractWalletFilename))
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -51,15 +50,14 @@ func initializeContractWallet(walletDir string) (*wallet.Wallet, error) {
} }
func openContractWallet(cmd *cobra.Command, walletDir string) (*wallet.Wallet, error) { func openContractWallet(cmd *cobra.Command, walletDir string) (*wallet.Wallet, error) {
p := path.Join(walletDir, contractWalletFilename) p := filepath.Join(walletDir, contractWalletFilename)
w, err := wallet.NewWalletFromFile(p) w, err := wallet.NewWalletFromFile(p)
if err != nil { if err != nil {
if !os.IsNotExist(err) { if !os.IsNotExist(err) {
return nil, fmt.Errorf("can't open wallet: %w", err) return nil, fmt.Errorf("can't open wallet: %w", err)
} }
cmd.Printf("Contract group wallet is missing, initialize at %s\n", cmd.Printf("Contract group wallet is missing, initialize at %s\n", p)
filepath.Join(walletDir, contractWalletFilename))
return initializeContractWallet(walletDir) return initializeContractWallet(walletDir)
} }