cmd: fix megacheck warnings (#14912)

* cmd: fix megacheck warnings

* cmd: revert time.Until changes, keep readFloat
pull/14927/head
Egon Elbre 7 years ago committed by Péter Szilágyi
parent 8c2cf3c66c
commit 85454e7678
  1. 5
      cmd/evm/disasm.go
  2. 2
      cmd/puppeth/ssh.go
  3. 2
      cmd/puppeth/wizard.go
  4. 26
      cmd/puppeth/wizard_network.go

@ -46,8 +46,5 @@ func disasmCmd(ctx *cli.Context) error {
code := strings.TrimSpace(string(in[:])) code := strings.TrimSpace(string(in[:]))
fmt.Printf("%v\n", code) fmt.Printf("%v\n", code)
if err = asm.PrintDisassembled(code); err != nil { return asm.PrintDisassembled(code)
return err
}
return nil
} }

@ -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 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 return nil
} }
// We have a mismatch, forbid connecting // We have a mismatch, forbid connecting

@ -160,6 +160,7 @@ func (w *wizard) readDefaultInt(def int) int {
} }
} }
/*
// readFloat reads a single line from stdin, trimming if from spaces, enforcing it // readFloat reads a single line from stdin, trimming if from spaces, enforcing it
// to parse into a float. // to parse into a float.
func (w *wizard) readFloat() float64 { func (w *wizard) readFloat() float64 {
@ -180,6 +181,7 @@ func (w *wizard) readFloat() float64 {
return val return val
} }
} }
*/
// readDefaultFloat reads a single line from stdin, trimming if from spaces, enforcing // 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. // it to parse into a float. If an empty line is entered, the default value is returned.

@ -71,22 +71,20 @@ func (w *wizard) makeServer() string {
fmt.Println() fmt.Println()
fmt.Println("Please enter remote server's address:") fmt.Println("Please enter remote server's address:")
for { // Read and fial the server to ensure docker is present
// Read and fial the server to ensure docker is present input := w.readString()
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()
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, // selectServer lists the user all the currnetly known servers to choose from,

Loading…
Cancel
Save