Skip to content

Commit

Permalink
[nspcc-dev#722] neofs-adm: Replace path with filepath package
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
  • Loading branch information
fyrchik authored and aprasolova committed Oct 19, 2022
1 parent f011f46 commit 369e38a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/neofs-adm/internal/modules/morph/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"os"
"path"
"path/filepath"

"github.com/nspcc-dev/neo-go/cli/input"
Expand All @@ -27,7 +26,7 @@ func initializeContractWallet(walletDir string) (*wallet.Wallet, error) {
return nil, err
}

w, err := wallet.NewWallet(path.Join(walletDir, contractWalletFilename))
w, err := wallet.NewWallet(filepath.Join(walletDir, contractWalletFilename))
if err != nil {
return nil, err
}
Expand All @@ -51,15 +50,14 @@ func initializeContractWallet(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)
if err != nil {
if !os.IsNotExist(err) {
return nil, fmt.Errorf("can't open wallet: %w", err)
}

cmd.Printf("Contract group wallet is missing, initialize at %s\n",
filepath.Join(walletDir, contractWalletFilename))
cmd.Printf("Contract group wallet is missing, initialize at %s\n", p)
return initializeContractWallet(walletDir)
}

Expand Down

0 comments on commit 369e38a

Please sign in to comment.