diff options
author | Egon Elbre <egonelbre@gmail.com> | 2017-08-07 19:34:21 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-08-07 19:34:21 +0800 |
commit | 85454e7678f8f295ae72b8579aa443f9e45344cb (patch) | |
tree | 264f1ed9c86a0c6abec55eb3dd59603b53c82d0a /cmd | |
parent | 8c2cf3c66cf1d678b8b22e2c6245976058bfb525 (diff) | |
download | dexon-85454e7678f8f295ae72b8579aa443f9e45344cb.tar dexon-85454e7678f8f295ae72b8579aa443f9e45344cb.tar.gz dexon-85454e7678f8f295ae72b8579aa443f9e45344cb.tar.bz2 dexon-85454e7678f8f295ae72b8579aa443f9e45344cb.tar.lz dexon-85454e7678f8f295ae72b8579aa443f9e45344cb.tar.xz dexon-85454e7678f8f295ae72b8579aa443f9e45344cb.tar.zst dexon-85454e7678f8f295ae72b8579aa443f9e45344cb.zip |
cmd: fix megacheck warnings (#14912)
* cmd: fix megacheck warnings
* cmd: revert time.Until changes, keep readFloat
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/evm/disasm.go | 5 | ||||
-rw-r--r-- | cmd/puppeth/ssh.go | 2 | ||||
-rw-r--r-- | cmd/puppeth/wizard.go | 2 | ||||
-rw-r--r-- | cmd/puppeth/wizard_network.go | 26 |
4 files changed, 16 insertions, 19 deletions
diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index a78b2a8e1..4a442cf78 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 93668945c..26f846685 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 288b67508..f19bcbbcd 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 0455e1ef3..ff2ff74f5 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, |