From 86f6568f6618945b19057553ec32690d723da982 Mon Sep 17 00:00:00 2001 From: ferhat elmas Date: Fri, 10 Nov 2017 18:06:45 +0100 Subject: build: enable unconvert linter (#15456) * build: enable unconvert linter - fixes #15453 - update code base for failing cases * cmd/puppeth: replace syscall.Stdin with os.Stdin.Fd() for unconvert linter --- cmd/puppeth/module_faucet.go | 2 +- cmd/puppeth/module_node.go | 2 +- cmd/puppeth/ssh.go | 3 +-- cmd/puppeth/wizard.go | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) (limited to 'cmd') diff --git a/cmd/puppeth/module_faucet.go b/cmd/puppeth/module_faucet.go index acf1e4324..3c1296bdd 100644 --- a/cmd/puppeth/module_faucet.go +++ b/cmd/puppeth/module_faucet.go @@ -133,7 +133,7 @@ func deployFaucet(client *sshClient, network string, bootnodes []string, config }) files[filepath.Join(workdir, "docker-compose.yaml")] = composefile.Bytes() - files[filepath.Join(workdir, "genesis.json")] = []byte(config.node.genesis) + files[filepath.Join(workdir, "genesis.json")] = config.node.genesis files[filepath.Join(workdir, "account.json")] = []byte(config.node.keyJSON) files[filepath.Join(workdir, "account.pass")] = []byte(config.node.keyPass) diff --git a/cmd/puppeth/module_node.go b/cmd/puppeth/module_node.go index 8f912f9eb..375e3e646 100644 --- a/cmd/puppeth/module_node.go +++ b/cmd/puppeth/module_node.go @@ -128,7 +128,7 @@ func deployNode(client *sshClient, network string, bootv4, bootv5 []string, conf files[filepath.Join(workdir, "docker-compose.yaml")] = composefile.Bytes() //genesisfile, _ := json.MarshalIndent(config.genesis, "", " ") - files[filepath.Join(workdir, "genesis.json")] = []byte(config.genesis) + files[filepath.Join(workdir, "genesis.json")] = config.genesis if config.keyJSON != "" { files[filepath.Join(workdir, "signer.json")] = []byte(config.keyJSON) diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index 26f846685..47378a606 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -27,7 +27,6 @@ import ( "os/user" "path/filepath" "strings" - "syscall" "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/ssh" @@ -85,7 +84,7 @@ func dial(server string, pubkey []byte) (*sshClient, error) { } auths = append(auths, ssh.PasswordCallback(func() (string, error) { fmt.Printf("What's the login password for %s at %s? (won't be echoed)\n> ", login, server) - blob, err := terminal.ReadPassword(int(syscall.Stdin)) + blob, err := terminal.ReadPassword(int(os.Stdin.Fd())) fmt.Println() return string(blob), err diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index 5fbc11cb9..eb6d9e5aa 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -28,7 +28,6 @@ import ( "sort" "strconv" "strings" - "syscall" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" @@ -231,7 +230,7 @@ func (w *wizard) readDefaultFloat(def float64) float64 { // line and returns it. The input will not be echoed. func (w *wizard) readPassword() string { fmt.Printf("> ") - text, err := terminal.ReadPassword(int(syscall.Stdin)) + text, err := terminal.ReadPassword(int(os.Stdin.Fd())) if err != nil { log.Crit("Failed to read password", "err", err) } -- cgit v1.2.3