diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index a78b2a8e184a892600216bbbf13d50a46bcfbb19..4a442cf784452b03c7f8bc1befde38824cb86138 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -46,8 +46,5 @@ func disasmCmd(ctx *cli.Context) error { code := strings.TrimSpace(string(in[:])) fmt.Printf("%v\n", code) - if err = asm.PrintDisassembled(code); err != nil { - return err - } - return nil + return asm.PrintDisassembled(code) } diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index 93668945c0d8f6218a8581e773ce8d4f965efffc..26f8466850bf47e090e64218d4e90a3cd788aa7a 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -122,7 +122,7 @@ func dial(server string, pubkey []byte) (*sshClient, error) { } } // If a public key exists for this SSH server, check that it matches - if bytes.Compare(pubkey, key.Marshal()) == 0 { + if bytes.Equal(pubkey, key.Marshal()) { return nil } // We have a mismatch, forbid connecting diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index 288b67508727df3c958b8d9030b513c7e70b507c..f19bcbbcd92a27a3c503e763714f9ee7cca88c64 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -160,6 +160,7 @@ func (w *wizard) readDefaultInt(def int) int { } } +/* // readFloat reads a single line from stdin, trimming if from spaces, enforcing it // to parse into a float. func (w *wizard) readFloat() float64 { @@ -180,6 +181,7 @@ func (w *wizard) readFloat() float64 { return val } } +*/ // readDefaultFloat reads a single line from stdin, trimming if from spaces, enforcing // it to parse into a float. If an empty line is entered, the default value is returned. diff --git a/cmd/puppeth/wizard_network.go b/cmd/puppeth/wizard_network.go index 0455e1ef3bc9ac6845f34b65eebc18d9cf74bfe0..ff2ff74f580b8826ba564c7f1071fb0bc73a3e18 100644 --- a/cmd/puppeth/wizard_network.go +++ b/cmd/puppeth/wizard_network.go @@ -71,22 +71,20 @@ func (w *wizard) makeServer() string { fmt.Println() fmt.Println("Please enter remote server's address:") - for { - // Read and fial the server to ensure docker is present - input := w.readString() - - client, err := dial(input, nil) - if err != nil { - log.Error("Server not ready for puppeth", "err", err) - return "" - } - // All checks passed, start tracking the server - w.servers[input] = client - w.conf.Servers[input] = client.pubkey - w.conf.flush() + // Read and fial the server to ensure docker is present + input := w.readString() - return input + client, err := dial(input, nil) + if err != nil { + log.Error("Server not ready for puppeth", "err", err) + return "" } + // All checks passed, start tracking the server + w.servers[input] = client + w.conf.Servers[input] = client.pubkey + w.conf.flush() + + return input } // selectServer lists the user all the currnetly known servers to choose from,