File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ var WalletCmd = &cobra.Command{
4545 var err error
4646 var mnemonic string
4747 if mode == "inspect" {
48- // in the case of inspect, we'll partse a mnemonic and then continue
48+ // in the case of inspect, we'll parse a mnemonic and then continue
4949 mnemonic , err = getFileOrFlag (inputMnemonicFile , inputMnemonic )
5050 if err != nil {
5151 return err
@@ -102,17 +102,16 @@ var WalletCmd = &cobra.Command{
102102}
103103
104104func getFileOrFlag (filename string , flag string ) (string , error ) {
105- if filename != "" {
106- filedata , err := os .ReadFile (filename )
107- if err != nil {
108- return "" , fmt .Errorf ("could not open the specified file %s. Got error %s" , filename , err .Error ())
109- }
110- return string (filedata ), nil
111- }
112- if flag != "" {
105+ if filename == "" {
113106 return flag , nil
114107 }
115- return "" , fmt .Errorf ("unable to determine flat or filename" )
108+
109+ filedata , err := os .ReadFile (filename )
110+ if err != nil {
111+ return "" , fmt .Errorf ("failed to read file %s: %w" , filename , err )
112+ }
113+
114+ return string (filedata ), nil
116115}
117116
118117func init () {
You can’t perform that action at this time.
0 commit comments