From ebf6df049d55f15477b86ac6178c5607c8504139 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Thu, 5 Apr 2018 11:27:39 +0200 Subject: [PATCH 01/15] #15473 - add lint task to makefile --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 3922d6015bb9..7338e8308a9c 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,15 @@ ios: test: all build/env.sh go run build/ci.go test +lint: install-linters ## Run linters. Use make install-linters first. + vendorcheck ./... + gometalinter --disable-all -E vet -E goimports -E varcheck --tests --vendor ./... + +install-linters: ## Install linters + go get -u github.com/FiloSottile/vendorcheck + go get -u github.com/alecthomas/gometalinter + gometalinter --vendored-linters --install + clean: rm -fr build/_workspace/pkg/ $(GOBIN)/* From 8889632abe74560afb177cdb376a0237182e50cb Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Thu, 5 Apr 2018 13:16:22 +0200 Subject: [PATCH 02/15] add gofmt, misspell, goconst, unconvert, gosimple, deadline=10m, min-occurrences=6 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7338e8308a9c..6766fd347f5f 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ test: all lint: install-linters ## Run linters. Use make install-linters first. vendorcheck ./... - gometalinter --disable-all -E vet -E goimports -E varcheck --tests --vendor ./... + gometalinter --disable-all -E vet -E goimports -E varcheck -E gofmt -E misspell -E goconst -E unconvert -E gosimple --deadline=10m --min-occurrences=6 --tests --vendor ./... install-linters: ## Install linters go get -u github.com/FiloSottile/vendorcheck From c41a7cc5fad942091c52565785d9a85eb57912a7 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Thu, 5 Apr 2018 13:59:49 +0200 Subject: [PATCH 03/15] fixing all linting errs add makefile for goimports -w run goimports add lint to travis build --- .travis.yml | 2 ++ Makefile | 5 +++- accounts/abi/bind/bind.go | 3 ++- accounts/abi/bind/bind_test.go | 3 ++- accounts/abi/event_test.go | 5 ++-- accounts/abi/type_test.go | 1 + accounts/abi/unpack_test.go | 3 ++- accounts/keystore/account_cache.go | 3 ++- accounts/keystore/account_cache_test.go | 1 + accounts/keystore/file_cache.go | 3 ++- accounts/keystore/key.go | 3 ++- accounts/keystore/keystore_passphrase.go | 7 ++--- accounts/keystore/presale.go | 5 ++-- accounts/keystore/watch.go | 3 ++- accounts/usbwallet/hub.go | 3 ++- accounts/usbwallet/ledger.go | 6 ++--- accounts/usbwallet/trezor.go | 3 ++- accounts/usbwallet/wallet.go | 3 ++- cmd/ethkey/generate.go | 5 ++-- cmd/ethkey/inspect.go | 3 ++- cmd/ethkey/main.go | 11 ++++---- cmd/ethkey/message.go | 3 ++- cmd/ethkey/run_test.go | 1 + cmd/ethkey/utils.go | 3 ++- cmd/evm/disasm.go | 3 ++- cmd/evm/main.go | 3 ++- cmd/evm/runner.go | 3 ++- cmd/faucet/faucet.go | 3 ++- cmd/geth/accountcmd.go | 3 ++- cmd/geth/bugcmd.go | 3 ++- cmd/geth/chaincmd.go | 5 ++-- cmd/geth/config.go | 3 ++- cmd/geth/consolecmd.go | 3 ++- cmd/geth/main.go | 3 ++- cmd/geth/misccmd.go | 3 ++- cmd/geth/monitorcmd.go | 5 ++-- cmd/geth/run_test.go | 1 + cmd/geth/usage.go | 3 ++- cmd/p2psim/main.go | 3 ++- cmd/puppeth/puppeth.go | 3 ++- cmd/puppeth/ssh.go | 3 ++- cmd/puppeth/wizard.go | 3 ++- cmd/puppeth/wizard_netstats.go | 3 ++- cmd/swarm/config.go | 3 ++- cmd/swarm/db.go | 3 ++- cmd/swarm/hash.go | 3 ++- cmd/swarm/list.go | 3 ++- cmd/swarm/manifest.go | 3 ++- cmd/swarm/run_test.go | 1 + cmd/swarm/upload.go | 3 ++- cmd/utils/customflags.go | 3 ++- cmd/utils/flags.go | 3 ++- cmd/wnode/main.go | 3 ++- consensus/clique/clique.go | 3 ++- consensus/clique/snapshot.go | 3 ++- consensus/consensus.go | 3 ++- consensus/ethash/consensus.go | 3 ++- consensus/ethash/ethash.go | 3 ++- console/bridge.go | 3 ++- console/console.go | 7 ++--- core/asm/compiler.go | 9 +++---- core/blockchain.go | 5 ++-- core/genesis_test.go | 1 + core/headerchain.go | 3 ++- core/state/database.go | 3 ++- core/state/state_test.go | 3 ++- core/tx_pool.go | 5 ++-- core/types/log_test.go | 1 + core/types/transaction.go | 2 +- core/vm/contracts.go | 3 ++- core/vm/instructions.go | 6 ++--- crypto/bn256/cloudflare/constants.go | 2 +- dashboard/dashboard.go | 3 ++- eth/api_test.go | 1 + eth/downloader/queue.go | 3 ++- eth/fetcher/fetcher.go | 3 ++- eth/peer.go | 3 ++- eth/tracers/tracer.go | 3 ++- ethdb/database.go | 5 ++-- ethstats/ethstats.go | 3 ++- internal/debug/flags.go | 5 ++-- internal/ethapi/api.go | 5 ++-- internal/jsre/jsre.go | 3 ++- les/bloombits.go | 12 ++++----- les/serverpool.go | 4 +-- les/sync.go | 4 +-- light/lightchain.go | 3 ++- light/trie_test.go | 1 + metrics/influxdb/influxdb.go | 3 ++- miner/worker.go | 3 ++- node/node.go | 3 ++- p2p/dial_test.go | 1 + p2p/discover/database.go | 7 ++--- p2p/discover/udp.go | 4 +-- p2p/discover/udp_test.go | 1 + p2p/discv5/database.go | 7 ++--- p2p/discv5/net.go | 7 ++--- p2p/discv5/table.go | 2 +- p2p/discv5/udp.go | 26 +++++++++---------- p2p/discv5/udp_test.go | 12 ++++----- p2p/enr/enr.go | 4 +-- p2p/enr/enr_test.go | 5 ++-- p2p/nat/nat.go | 3 ++- p2p/peer.go | 4 +-- p2p/rlpx.go | 3 ++- p2p/rlpx_test.go | 1 + p2p/simulations/adapters/docker.go | 1 + p2p/simulations/adapters/exec.go | 3 ++- p2p/simulations/adapters/types.go | 1 + p2p/simulations/http.go | 5 ++-- rpc/client_test.go | 1 + rpc/server.go | 3 ++- rpc/types.go | 3 ++- rpc/websocket.go | 3 ++- swarm/api/http/server.go | 3 ++- swarm/fuse/fuse_dir.go | 7 ++--- swarm/fuse/fuse_file.go | 3 ++- swarm/fuse/swarmfs.go | 3 ++- swarm/fuse/swarmfs_unix.go | 1 + swarm/metrics/flags.go | 3 ++- swarm/network/syncdb.go | 5 ++-- swarm/storage/database.go | 3 ++- swarm/storage/dbstore.go | 7 ++--- swarm/storage/netstore.go | 4 +-- trie/sync.go | 3 ++- trie/trie_test.go | 1 + .../robertkrimen/otto/ast/comments.go | 1 + vendor/github.com/robertkrimen/otto/result.go | 2 -- .../stretchr/testify/require/require.go | 3 ++- .../testify/require/require_forward.go | 3 ++- .../syndtr/goleveldb/leveldb/storage.go | 3 ++- .../x/crypto/openpgp/armor/armor.go | 3 ++- .../x/crypto/openpgp/packet/compressed.go | 3 ++- .../openpgp/packet/one_pass_signature.go | 5 ++-- .../x/crypto/openpgp/packet/packet.go | 5 ++-- .../x/crypto/openpgp/packet/reader.go | 3 ++- .../openpgp/packet/symmetrically_encrypted.go | 3 ++- .../x/crypto/ssh/terminal/util_solaris.go | 3 ++- vendor/gopkg.in/check.v1/benchmark.go | 6 ++--- whisper/mailserver/mailserver.go | 5 ++-- whisper/whisperv5/api.go | 2 +- whisper/whisperv5/peer.go | 3 ++- whisper/whisperv5/whisper.go | 9 ++++--- whisper/whisperv6/api.go | 2 +- whisper/whisperv6/api_test.go | 3 ++- whisper/whisperv6/benchmarks_test.go | 3 ++- whisper/whisperv6/peer.go | 3 ++- whisper/whisperv6/whisper.go | 9 ++++--- whisper/whisperv6/whisper_test.go | 3 ++- 149 files changed, 339 insertions(+), 209 deletions(-) diff --git a/.travis.yml b/.travis.yml index 40d940de0d5b..8a97bcd35e47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,8 @@ matrix: - sudo chown root:$USER /etc/fuse.conf - go run build/ci.go install - go run build/ci.go test -coverage + - make install-linters + - make lint # These are the latest Go versions. - os: linux diff --git a/Makefile b/Makefile index 6766fd347f5f..a13fe497ba50 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ ios: test: all build/env.sh go run build/ci.go test -lint: install-linters ## Run linters. Use make install-linters first. +lint: ## Run linters. Use make install-linters first. vendorcheck ./... gometalinter --disable-all -E vet -E goimports -E varcheck -E gofmt -E misspell -E goconst -E unconvert -E gosimple --deadline=10m --min-occurrences=6 --tests --vendor ./... @@ -46,6 +46,9 @@ install-linters: ## Install linters go get -u github.com/alecthomas/gometalinter gometalinter --vendored-linters --install +format: # Formats the code. Must have goimports installed (use make install-linters). + goimports -w -local github.com/ethereum/go-ethereum ./ + clean: rm -fr build/_workspace/pkg/ $(GOBIN)/* diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index 411177057b97..6a5c60931353 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -28,8 +28,9 @@ import ( "text/template" "unicode" - "github.com/ethereum/go-ethereum/accounts/abi" "golang.org/x/tools/imports" + + "github.com/ethereum/go-ethereum/accounts/abi" ) // Lang is a target programming language selector to generate bindings for. diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index 2a5a88648771..5abad1c69d03 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -26,8 +26,9 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" "golang.org/x/tools/imports" + + "github.com/ethereum/go-ethereum/common" ) var bindTests = []struct { diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index cca61e433dd6..c4498e915113 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -25,10 +25,11 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" ) var jsonEventTransfer = []byte(`{ diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index f6b36f18fd54..fe7436937463 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" ) diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index bdbab10b4f43..59d394a79f12 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -26,8 +26,9 @@ import ( "strings" "testing" - "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/common" ) type unpackTest struct { diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 71f698ece71a..95c4dec26889 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -27,10 +27,11 @@ import ( "sync" "time" + "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" - "gopkg.in/fatih/set.v0" ) // Minimum amount of time between cache reloads. This limit applies if the platform does diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index fe9233c046e7..884c7489155c 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -29,6 +29,7 @@ import ( "github.com/cespare/cp" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" ) diff --git a/accounts/keystore/file_cache.go b/accounts/keystore/file_cache.go index c91b7b7b6104..86aa765a3490 100644 --- a/accounts/keystore/file_cache.go +++ b/accounts/keystore/file_cache.go @@ -24,8 +24,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" set "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/log" ) // fileCache is a cache of files seen during scan of keystore. diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index 211fa863d7bd..65e956f3ea66 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -29,10 +29,11 @@ import ( "strings" "time" + "github.com/pborman/uuid" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "github.com/pborman/uuid" ) const ( diff --git a/accounts/keystore/keystore_passphrase.go b/accounts/keystore/keystore_passphrase.go index eaec39f7df28..76b77423a8c5 100644 --- a/accounts/keystore/keystore_passphrase.go +++ b/accounts/keystore/keystore_passphrase.go @@ -36,13 +36,14 @@ import ( "io/ioutil" "path/filepath" + "github.com/pborman/uuid" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/crypto/scrypt" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/randentropy" - "github.com/pborman/uuid" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/crypto/scrypt" ) const ( diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index 1554294e14e1..3c7550f38639 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -25,10 +25,11 @@ import ( "errors" "fmt" - "github.com/ethereum/go-ethereum/accounts" - "github.com/ethereum/go-ethereum/crypto" "github.com/pborman/uuid" "golang.org/x/crypto/pbkdf2" + + "github.com/ethereum/go-ethereum/accounts" + "github.com/ethereum/go-ethereum/crypto" ) // creates a Key and stores that in the given KeyStore by decrypting a presale key JSON diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index bbcfb99257ad..82c9b10e4a2a 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -21,8 +21,9 @@ package keystore import ( "time" - "github.com/ethereum/go-ethereum/log" "github.com/rjeczalik/notify" + + "github.com/ethereum/go-ethereum/log" ) type watcher struct { diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 61fc98ccc80e..1989a9e366f3 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -22,10 +22,11 @@ import ( "sync" "time" + "github.com/karalabe/hid" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" - "github.com/karalabe/hid" ) // LedgerScheme is the protocol scheme prefixing account and wallet URLs. diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index f5def61d235c..9da72462a956 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -52,12 +52,12 @@ const ( ledgerOpSignTransaction ledgerOpcode = 0x04 // Signs an Ethereum transaction after having the user validate the parameters ledgerOpGetConfiguration ledgerOpcode = 0x06 // Returns specific wallet application configuration - ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet - ledgerP1ConfirmFetchAddress ledgerParam1 = 0x01 // Require a user confirmation before returning the address + ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet + //ledgerP1ConfirmFetchAddress ledgerParam1 = 0x01 // Require a user confirmation before returning the address ledgerP1InitTransactionData ledgerParam1 = 0x00 // First transaction data block for signing ledgerP1ContTransactionData ledgerParam1 = 0x80 // Subsequent transaction data block for signing ledgerP2DiscardAddressChainCode ledgerParam2 = 0x00 // Do not return the chain code along with the address - ledgerP2ReturnAddressChainCode ledgerParam2 = 0x01 // Require a user confirmation before returning the address + //ledgerP2ReturnAddressChainCode ledgerParam2 = 0x01 // Require a user confirmation before returning the address ) // errLedgerReplyInvalidHeader is the error message returned by a Ledger data exchange diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index b84a955992ff..35f7e6aa889c 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,13 +27,14 @@ import ( "io" "math/big" + "github.com/golang/protobuf/proto" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/usbwallet/internal/trezor" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "github.com/golang/protobuf/proto" ) // ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 8b3b5a522402..30712dc5d2c3 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,12 +25,13 @@ import ( "sync" "time" + "github.com/karalabe/hid" + ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "github.com/karalabe/hid" ) // Maximum time between wallet health checks to detect USB unplugs. diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index 6d57d17fb4e8..b4d22613bd5b 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -23,11 +23,12 @@ import ( "os" "path/filepath" + "github.com/pborman/uuid" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/crypto" - "github.com/pborman/uuid" - "gopkg.in/urfave/cli.v1" ) type outputGenerate struct { diff --git a/cmd/ethkey/inspect.go b/cmd/ethkey/inspect.go index dbf5afc0cee9..fdb7d2d95d16 100644 --- a/cmd/ethkey/inspect.go +++ b/cmd/ethkey/inspect.go @@ -21,10 +21,11 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) type outputInspect struct { diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index 2a9e5ee4838b..17b449739616 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -20,8 +20,9 @@ import ( "fmt" "os" - "github.com/ethereum/go-ethereum/cmd/utils" "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/cmd/utils" ) const ( @@ -53,10 +54,10 @@ var ( Name: "json", Usage: "output JSON instead of human-readable format", } - messageFlag = cli.StringFlag{ - Name: "message", - Usage: "the file that contains the message to sign/verify", - } + //messageFlag = cli.StringFlag{ + // Name: "message", + // Usage: "the file that contains the message to sign/verify", + //} ) func main() { diff --git a/cmd/ethkey/message.go b/cmd/ethkey/message.go index 531a931c82f6..5535757d9fd8 100644 --- a/cmd/ethkey/message.go +++ b/cmd/ethkey/message.go @@ -21,11 +21,12 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) type outputSign struct { diff --git a/cmd/ethkey/run_test.go b/cmd/ethkey/run_test.go index 6006f6b5bb70..857d3045abb8 100644 --- a/cmd/ethkey/run_test.go +++ b/cmd/ethkey/run_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/internal/cmdtest" ) diff --git a/cmd/ethkey/utils.go b/cmd/ethkey/utils.go index 0e563bf9225a..8f0f019fc6ee 100644 --- a/cmd/ethkey/utils.go +++ b/cmd/ethkey/utils.go @@ -22,10 +22,11 @@ import ( "io/ioutil" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/crypto" - "gopkg.in/urfave/cli.v1" ) // getPassPhrase obtains a passphrase given by the user. It first checks the diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index 4a442cf78445..19bc28e15a7d 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -22,8 +22,9 @@ import ( "io/ioutil" "strings" - "github.com/ethereum/go-ethereum/core/asm" cli "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/core/asm" ) var disasmCommand = cli.Command{ diff --git a/cmd/evm/main.go b/cmd/evm/main.go index a59cb1fb8430..1994c08a1820 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -22,8 +22,9 @@ import ( "math/big" "os" - "github.com/ethereum/go-ethereum/cmd/utils" "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/cmd/utils" ) var gitCommit = "" // Git SHA1 commit hash of the release (set via linker flags) diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 8a7399840cf7..0e44e84aa5a5 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -27,6 +27,8 @@ import ( goruntime "runtime" + cli "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" @@ -37,7 +39,6 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - cli "gopkg.in/urfave/cli.v1" ) var runCommand = cli.Command{ diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 5bad09bbd576..9668813c034a 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -41,6 +41,8 @@ import ( "sync" "time" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -58,7 +60,6 @@ import ( "github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/params" - "golang.org/x/net/websocket" ) var ( diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index 0db5c4ce0f8e..2d6cd5ca9511 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -20,13 +20,14 @@ import ( "fmt" "io/ioutil" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/bugcmd.go b/cmd/geth/bugcmd.go index ce9dbe6c0a75..ecfb7ffa2234 100644 --- a/cmd/geth/bugcmd.go +++ b/cmd/geth/bugcmd.go @@ -29,8 +29,9 @@ import ( "github.com/ethereum/go-ethereum/cmd/internal/browser" "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/cmd/utils" cli "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/cmd/utils" ) var bugCommand = cli.Command{ diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index d3086921b95a..9336c614f45b 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -25,6 +25,9 @@ import ( "sync/atomic" "time" + "github.com/syndtr/goleveldb/leveldb/util" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" @@ -36,8 +39,6 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/trie" - "github.com/syndtr/goleveldb/leveldb/util" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/config.go b/cmd/geth/config.go index e6bd4d5bef41..1cd9c6be986b 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -27,13 +27,14 @@ import ( cli "gopkg.in/urfave/cli.v1" + "github.com/naoina/toml" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/dashboard" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" - "github.com/naoina/toml" ) var ( diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 2500a969cf5e..9d52f27dbfe1 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -24,11 +24,12 @@ import ( "strings" "syscall" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/main.go b/cmd/geth/main.go index d94154245f1b..3bccb0666be3 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -25,6 +25,8 @@ import ( "strings" "time" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" @@ -35,7 +37,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/node" - "gopkg.in/urfave/cli.v1" ) const ( diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index aa9b1ee568e7..3106075808d1 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -23,11 +23,12 @@ import ( "strconv" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/params" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go index cd19caa2765c..5f0f5cbd6791 100644 --- a/cmd/geth/monitorcmd.go +++ b/cmd/geth/monitorcmd.go @@ -25,11 +25,12 @@ import ( "strings" "time" + "github.com/gizak/termui" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" - "github.com/gizak/termui" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index da82facac36e..f94050124a27 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/internal/cmdtest" ) diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index a1558c2330c9..5378bdc935bc 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -24,9 +24,10 @@ import ( "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/internal/debug" - "gopkg.in/urfave/cli.v1" ) // AppHelpTemplate is the test template for the default, global app help topic. diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index 0c8ed038d5b6..38a54add4e2d 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,13 +45,14 @@ import ( "strings" "text/tabwriter" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/simulations" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" - "gopkg.in/urfave/cli.v1" ) var client *simulations.Client diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index f9b8fe481153..9328f5280bb8 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -23,8 +23,9 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/log" ) // main is just a boring entry point to set up the CLI app. diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index 158261ce0516..ffc1488336e4 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -28,9 +28,10 @@ import ( "path/filepath" "strings" - "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/terminal" + + "github.com/ethereum/go-ethereum/log" ) // sshClient is a small wrapper around Go's SSH client with a few utility methods diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index b88a61de7ded..09f67809fe32 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -30,10 +30,11 @@ import ( "strings" "sync" + "golang.org/x/crypto/ssh/terminal" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/log" - "golang.org/x/crypto/ssh/terminal" ) // config contains all the configurations needed by puppeth that should be saved diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index 90bf7ae3c8dc..3c0292505492 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,9 +23,10 @@ import ( "strings" "sync" + "github.com/olekukonko/tablewriter" + "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/log" - "github.com/olekukonko/tablewriter" ) // networkStats verifies the status of network components and generates a protip diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index adac772babce..bfd1a3d96184 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -28,11 +28,12 @@ import ( cli "gopkg.in/urfave/cli.v1" + "github.com/naoina/toml" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" - "github.com/naoina/toml" bzzapi "github.com/ethereum/go-ethereum/swarm/api" ) diff --git a/cmd/swarm/db.go b/cmd/swarm/db.go index dfd2d069b975..4ea97af75cbc 100644 --- a/cmd/swarm/db.go +++ b/cmd/swarm/db.go @@ -22,10 +22,11 @@ import ( "os" "path/filepath" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" - "gopkg.in/urfave/cli.v1" ) func dbExport(ctx *cli.Context) { diff --git a/cmd/swarm/hash.go b/cmd/swarm/hash.go index 792e8d0d7afb..b89de1df099e 100644 --- a/cmd/swarm/hash.go +++ b/cmd/swarm/hash.go @@ -21,9 +21,10 @@ import ( "fmt" "os" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/storage" - "gopkg.in/urfave/cli.v1" ) func hash(ctx *cli.Context) { diff --git a/cmd/swarm/list.go b/cmd/swarm/list.go index 57b5517c6ef5..a4dd422187e2 100644 --- a/cmd/swarm/list.go +++ b/cmd/swarm/list.go @@ -22,9 +22,10 @@ import ( "strings" "text/tabwriter" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" swarm "github.com/ethereum/go-ethereum/swarm/api/client" - "gopkg.in/urfave/cli.v1" ) func list(ctx *cli.Context) { diff --git a/cmd/swarm/manifest.go b/cmd/swarm/manifest.go index 41a69a5d05f3..f286a7e056b4 100644 --- a/cmd/swarm/manifest.go +++ b/cmd/swarm/manifest.go @@ -24,10 +24,11 @@ import ( "path/filepath" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/api" swarm "github.com/ethereum/go-ethereum/swarm/api/client" - "gopkg.in/urfave/cli.v1" ) const bzzManifestJSON = "application/bzz-manifest+json" diff --git a/cmd/swarm/run_test.go b/cmd/swarm/run_test.go index 594cfa55cb48..76310e2fa070 100644 --- a/cmd/swarm/run_test.go +++ b/cmd/swarm/run_test.go @@ -27,6 +27,7 @@ import ( "time" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/internal/cmdtest" diff --git a/cmd/swarm/upload.go b/cmd/swarm/upload.go index 9f4c525bb92a..b0d587129fa0 100644 --- a/cmd/swarm/upload.go +++ b/cmd/swarm/upload.go @@ -30,9 +30,10 @@ import ( "path/filepath" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" swarm "github.com/ethereum/go-ethereum/swarm/api/client" - "gopkg.in/urfave/cli.v1" ) func upload(ctx *cli.Context) { diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index e5bf8724c17a..06de36666ae2 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -27,8 +27,9 @@ import ( "path" "strings" - "github.com/ethereum/go-ethereum/common/math" "gopkg.in/urfave/cli.v1" + + "github.com/ethereum/go-ethereum/common/math" ) // Custom type which is registered in the flags library which cli uses for diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 4f3d81f5d2aa..dadac12d28a9 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -28,6 +28,8 @@ import ( "strconv" "strings" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -56,7 +58,6 @@ import ( "github.com/ethereum/go-ethereum/p2p/netutil" "github.com/ethereum/go-ethereum/params" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/wnode/main.go b/cmd/wnode/main.go index 988c50ce3d67..6aeeb1bbe352 100644 --- a/cmd/wnode/main.go +++ b/cmd/wnode/main.go @@ -35,6 +35,8 @@ import ( "strings" "time" + "golang.org/x/crypto/pbkdf2" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" @@ -45,7 +47,6 @@ import ( "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/whisper/mailserver" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" - "golang.org/x/crypto/pbkdf2" ) const quitCommand = "~Q" diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 2bdad9092aa4..22476d94fbd9 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -25,6 +25,8 @@ import ( "sync" "time" + lru "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -39,7 +41,6 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" - lru "github.com/hashicorp/golang-lru" ) const ( diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 9ebdb8df1580..d71ced007f0f 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -20,11 +20,12 @@ import ( "bytes" "encoding/json" + lru "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/params" - lru "github.com/hashicorp/golang-lru" ) // Vote represents a single vote that an authorized signer made to modify the diff --git a/consensus/consensus.go b/consensus/consensus.go index be5e661c12bc..5774af1a78eb 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -18,12 +18,13 @@ package consensus import ( + "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" - "math/big" ) // ChainReader defines a small collection of methods needed to access the local diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 99eec82211e2..477019c51d76 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -24,6 +24,8 @@ import ( "runtime" "time" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/consensus" @@ -31,7 +33,6 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" - set "gopkg.in/fatih/set.v0" ) // Ethash proof-of-work protocol constants. diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 1b3dcee30288..ba56fb92ea50 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -33,11 +33,12 @@ import ( "unsafe" mmap "github.com/edsrzf/mmap-go" + "github.com/hashicorp/golang-lru/simplelru" + "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/rpc" - "github.com/hashicorp/golang-lru/simplelru" ) var ErrInvalidDumpMagic = errors.New("invalid dump magic") diff --git a/console/bridge.go b/console/bridge.go index b28cc438e210..dd12f797e055 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -23,10 +23,11 @@ import ( "strings" "time" + "github.com/robertkrimen/otto" + "github.com/ethereum/go-ethereum/accounts/usbwallet" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rpc" - "github.com/robertkrimen/otto" ) // bridge is a collection of JavaScript utility methods to bride the .js runtime diff --git a/console/console.go b/console/console.go index b280d4e65d4c..cef5d3c7be09 100644 --- a/console/console.go +++ b/console/console.go @@ -28,12 +28,13 @@ import ( "strings" "syscall" - "github.com/ethereum/go-ethereum/internal/jsre" - "github.com/ethereum/go-ethereum/internal/web3ext" - "github.com/ethereum/go-ethereum/rpc" "github.com/mattn/go-colorable" "github.com/peterh/liner" "github.com/robertkrimen/otto" + + "github.com/ethereum/go-ethereum/internal/jsre" + "github.com/ethereum/go-ethereum/internal/web3ext" + "github.com/ethereum/go-ethereum/rpc" ) var ( diff --git a/core/asm/compiler.go b/core/asm/compiler.go index 18dc0877ffea..abe2992a9292 100644 --- a/core/asm/compiler.go +++ b/core/asm/compiler.go @@ -17,7 +17,6 @@ package asm import ( - "errors" "fmt" "math/big" "os" @@ -264,10 +263,10 @@ func (err compileError) Error() string { return fmt.Sprintf("%d syntax error: unexpected %v, expected %v", err.lineno, err.got, err.want) } -var ( - errExpBol = errors.New("expected beginning of line") - errExpElementOrLabel = errors.New("expected beginning of line") -) +//var ( +// errExpBol = errors.New("expected beginning of line") +// errExpElementOrLabel = errors.New("expected beginning of line") +//) func compileErr(c token, got, want string) error { return compileError{ diff --git a/core/blockchain.go b/core/blockchain.go index b33eb85a4479..48bbf220ee37 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -27,6 +27,9 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/mclock" "github.com/ethereum/go-ethereum/consensus" @@ -41,8 +44,6 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" - "github.com/hashicorp/golang-lru" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) var ( diff --git a/core/genesis_test.go b/core/genesis_test.go index 052ded6991f9..48845c12864c 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -22,6 +22,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core/vm" diff --git a/core/headerchain.go b/core/headerchain.go index 2d1b0a2a185f..70dfe6dd20a6 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,13 +26,14 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "github.com/hashicorp/golang-lru" ) const ( diff --git a/core/state/database.go b/core/state/database.go index c1b630991ce0..8bf8b9b411e3 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -20,10 +20,11 @@ import ( "fmt" "sync" + lru "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/trie" - lru "github.com/hashicorp/golang-lru" ) // Trie cache generation limit after which to evict trie nodes from memory. diff --git a/core/state/state_test.go b/core/state/state_test.go index 6d42d63d8290..5e527fc11536 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -21,10 +21,11 @@ import ( "math/big" "testing" + checker "gopkg.in/check.v1" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" - checker "gopkg.in/check.v1" ) type StateSuite struct { diff --git a/core/tx_pool.go b/core/tx_pool.go index 089bd215ad50..8db43e811cf2 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -25,6 +25,8 @@ import ( "sync" "time" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" @@ -32,14 +34,13 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/params" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) const ( // chainHeadChanSize is the size of channel listening to ChainHeadEvent. chainHeadChanSize = 10 // rmTxChanSize is the size of channel listening to RemovedTransactionEvent. - rmTxChanSize = 10 + //rmTxChanSize = 10 ) var ( diff --git a/core/types/log_test.go b/core/types/log_test.go index 0e56acfe4aa3..bbe872b6647a 100644 --- a/core/types/log_test.go +++ b/core/types/log_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ) diff --git a/core/types/transaction.go b/core/types/transaction.go index 5660582baf16..2cb6612d48f6 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -34,7 +34,7 @@ import ( var ( ErrInvalidSig = errors.New("invalid transaction v, r, s values") - errNoSigner = errors.New("missing signing methods") + //errNoSigner = errors.New("missing signing methods") ) // deriveSigner makes a *best* guess about which signer to use. diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 237450ea96b0..237ac18d7d3c 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -21,12 +21,13 @@ import ( "errors" "math/big" + "golang.org/x/crypto/ripemd160" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/bn256" "github.com/ethereum/go-ethereum/params" - "golang.org/x/crypto/ripemd160" ) // PrecompiledContract is the basic interface for native Go contracts. The implementation diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 1e494a0eb89e..bcb8c40bfa1b 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -29,9 +29,9 @@ import ( ) var ( - bigZero = new(big.Int) - tt255 = math.BigPow(2, 255) - tt256 = math.BigPow(2, 256) + bigZero = new(big.Int) + tt255 = math.BigPow(2, 255) + //tt256 = math.BigPow(2, 256) errWriteProtection = errors.New("evm: write protection") errReturnDataOutOfBounds = errors.New("evm: return data out of bounds") errExecutionReverted = errors.New("evm: execution reverted") diff --git a/crypto/bn256/cloudflare/constants.go b/crypto/bn256/cloudflare/constants.go index 5122aae64f1e..97874bb760ae 100644 --- a/crypto/bn256/cloudflare/constants.go +++ b/crypto/bn256/cloudflare/constants.go @@ -26,7 +26,7 @@ var P = bigFromBase10("218882428718392752222464057452572750886963111572978236626 var p2 = [4]uint64{0x3c208c16d87cfd47, 0x97816a916871ca8d, 0xb85045b68181585d, 0x30644e72e131a029} // np is the negative inverse of p, mod 2^256. -var np = [4]uint64{0x87d20782e4866389, 0x9ede7d651eca6ac9, 0xd8afcbd01833da80, 0xf57a22b791888c6b} +//var np = [4]uint64{0x87d20782e4866389, 0x9ede7d651eca6ac9, 0xd8afcbd01833da80, 0xf57a22b791888c6b} // rN1 is R^-1 where R = 2^256 mod p. var rN1 = &gfP{0xed84884a014afa37, 0xeb2022850278edf8, 0xcf63e9cfb74492d9, 0x2e67157159e5c639} diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index 399fa34c08e6..bc222123a85c 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -33,12 +33,13 @@ import ( "time" "github.com/elastic/gosigar" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" - "golang.org/x/net/websocket" ) const ( diff --git a/eth/api_test.go b/eth/api_test.go index 900a82bb6a14..99d8e3bbffa3 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -21,6 +21,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/ethdb" diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index bbe0aed5dca6..cd065caf1e62 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -25,11 +25,12 @@ import ( "sync" "time" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) var ( diff --git a/eth/fetcher/fetcher.go b/eth/fetcher/fetcher.go index 0c679cec3a78..7e2077b46238 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -22,11 +22,12 @@ import ( "math/rand" "time" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) const ( diff --git a/eth/peer.go b/eth/peer.go index 42ead539653d..72f1f0e81377 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -23,11 +23,12 @@ import ( "sync" "time" + "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" - "gopkg.in/fatih/set.v0" ) var ( diff --git a/eth/tracers/tracer.go b/eth/tracers/tracer.go index 4cec9e633c37..430514883797 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -25,12 +25,13 @@ import ( "time" "unsafe" + duktape "gopkg.in/olebedev/go-duktape.v3" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" - duktape "gopkg.in/olebedev/go-duktape.v3" ) // bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js. diff --git a/ethdb/database.go b/ethdb/database.go index 30ed37dc7b64..f4ac51622a96 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -22,14 +22,15 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/filter" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/util" + + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" ) var OpenFileLimit = 64 diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index ae7e25265460..d290fd615d96 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -30,6 +30,8 @@ import ( "strings" "time" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/mclock" "github.com/ethereum/go-ethereum/consensus" @@ -41,7 +43,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" - "golang.org/x/net/websocket" ) const ( diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 1f181bf8b0f0..2ef0e07022ea 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,12 +24,13 @@ import ( "os" "runtime" + colorable "github.com/mattn/go-colorable" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log/term" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics/exp" - colorable "github.com/mattn/go-colorable" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 6525aa212c87..dc39e09c1dc9 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -25,6 +25,9 @@ import ( "strings" "time" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/util" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -40,8 +43,6 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/util" ) const ( diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go index f05865eca60d..b8079b21373d 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -26,9 +26,10 @@ import ( "math/rand" "time" + "github.com/robertkrimen/otto" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/internal/jsre/deps" - "github.com/robertkrimen/otto" ) var ( diff --git a/les/bloombits.go b/les/bloombits.go index de233d751830..900b7a7af0e4 100644 --- a/les/bloombits.go +++ b/les/bloombits.go @@ -74,11 +74,11 @@ func (eth *LightEthereum) startBloomHandlers() { } const ( - // bloomConfirms is the number of confirmation blocks before a bloom section is - // considered probably final and its rotated bits are calculated. - bloomConfirms = 256 +// bloomConfirms is the number of confirmation blocks before a bloom section is +// considered probably final and its rotated bits are calculated. +//bloomConfirms = 256 - // bloomThrottling is the time to wait between processing two consecutive index - // sections. It's useful during chain upgrades to prevent disk overload. - bloomThrottling = 100 * time.Millisecond +// bloomThrottling is the time to wait between processing two consecutive index +// sections. It's useful during chain upgrades to prevent disk overload. +//bloomThrottling = 100 * time.Millisecond ) diff --git a/les/serverpool.go b/les/serverpool.go index a84c29c3ac51..a87d8d18af6e 100644 --- a/les/serverpool.go +++ b/les/serverpool.go @@ -73,7 +73,7 @@ const ( // and a short term value which is adjusted exponentially with a factor of // pstatRecentAdjust with each dial/connection and also returned exponentially // to the average with the time constant pstatReturnToMeanTC - pstatRecentAdjust = 0.1 + //pstatRecentAdjust = 0.1 pstatReturnToMeanTC = time.Hour // node address selection weight is dropped by a factor of exp(-addrFailDropLn) after // each unsuccessful connection (restored after a successful one) @@ -85,7 +85,7 @@ const ( timeoutPow = 10 // peerSelectMinWeight is added to calculated weights at request peer selection // to give poorly performing peers a little chance of coming back - peerSelectMinWeight = 0.005 + //peerSelectMinWeight = 0.005 // initStatsWeight is used to initialize previously unknown peers with good // statistics to give a chance to prove themselves initStatsWeight = 1 diff --git a/les/sync.go b/les/sync.go index c0e17f97d96b..22825b1e052c 100644 --- a/les/sync.go +++ b/les/sync.go @@ -26,8 +26,8 @@ import ( ) const ( - //forceSyncCycle = 10 * time.Second // Time interval to force syncs, even if few peers are available - minDesiredPeerCount = 5 // Amount of peers desired to start syncing +//forceSyncCycle = 10 * time.Second // Time interval to force syncs, even if few peers are available +//minDesiredPeerCount = 5 // Amount of peers desired to start syncing ) // syncer is responsible for periodically synchronising with the network, both diff --git a/light/lightchain.go b/light/lightchain.go index 2784615d35d4..e2538b9ac632 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -24,6 +24,8 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core" @@ -34,7 +36,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" - "github.com/hashicorp/golang-lru" ) var ( diff --git a/light/trie_test.go b/light/trie_test.go index 0d6b2cc1d8dd..876caa9ed7d6 100644 --- a/light/trie_test.go +++ b/light/trie_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index d5cb4da66fad..94f5ec4e4f12 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -6,8 +6,9 @@ import ( uurl "net/url" "time" - "github.com/ethereum/go-ethereum/metrics" "github.com/influxdata/influxdb/client" + + "github.com/ethereum/go-ethereum/metrics" ) type reporter struct { diff --git a/miner/worker.go b/miner/worker.go index 15395ae0b93c..1a301bf07404 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -24,6 +24,8 @@ import ( "sync/atomic" "time" + "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/misc" @@ -35,7 +37,6 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - "gopkg.in/fatih/set.v0" ) const ( diff --git a/node/node.go b/node/node.go index b02aecfad15f..eebbd9240125 100644 --- a/node/node.go +++ b/node/node.go @@ -26,6 +26,8 @@ import ( "strings" "sync" + "github.com/prometheus/prometheus/util/flock" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" @@ -33,7 +35,6 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" - "github.com/prometheus/prometheus/util/flock" ) // Node is a container on which services can be registered. diff --git a/p2p/dial_test.go b/p2p/dial_test.go index 2a7941fc6574..603021e823a5 100644 --- a/p2p/dial_test.go +++ b/p2p/dial_test.go @@ -24,6 +24,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/netutil" ) diff --git a/p2p/discover/database.go b/p2p/discover/database.go index 6f98de9b4246..0b856d68c65a 100644 --- a/p2p/discover/database.go +++ b/p2p/discover/database.go @@ -27,15 +27,16 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/storage" "github.com/syndtr/goleveldb/leveldb/util" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/discover/udp.go b/p2p/discover/udp.go index 524c6e498828..f585452f4712 100644 --- a/p2p/discover/udp.go +++ b/p2p/discover/udp.go @@ -49,8 +49,8 @@ var ( // Timeouts const ( respTimeout = 500 * time.Millisecond - sendTimeout = 500 * time.Millisecond - expiration = 20 * time.Second + //sendTimeout = 500 * time.Millisecond + expiration = 20 * time.Second ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP ntpWarningCooldown = 10 * time.Minute // Minimum amount of time to pass before repeating NTP warning diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go index db9804f7bc6c..817b6e26f4e8 100644 --- a/p2p/discover/udp_test.go +++ b/p2p/discover/udp_test.go @@ -34,6 +34,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" diff --git a/p2p/discv5/database.go b/p2p/discv5/database.go index 3c2d5744c383..514ae49ef063 100644 --- a/p2p/discv5/database.go +++ b/p2p/discv5/database.go @@ -28,15 +28,16 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/storage" "github.com/syndtr/goleveldb/leveldb/util" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go index 52c677b623b3..618340b291c2 100644 --- a/p2p/discv5/net.go +++ b/p2p/discv5/net.go @@ -36,7 +36,7 @@ import ( var ( errInvalidEvent = errors.New("invalid in current state") errNoQuery = errors.New("no pending query") - errWrongAddress = errors.New("unknown sender address") + //errWrongAddress = errors.New("unknown sender address") ) const ( @@ -828,11 +828,12 @@ type nodeEvent uint //go:generate stringer -type=nodeEvent const ( - invalidEvent nodeEvent = iota // zero is reserved + //invalidEvent + //nodeEvent = iota // zero is reserved // Packet type events. // These correspond to packet types in the UDP protocol. - pingPacket + pingPacket = iota pongPacket findnodePacket neighborsPacket diff --git a/p2p/discv5/table.go b/p2p/discv5/table.go index 2cf05009cb0f..2c7116610ad2 100644 --- a/p2p/discv5/table.go +++ b/p2p/discv5/table.go @@ -38,7 +38,7 @@ const ( hashBits = len(common.Hash{}) * 8 nBuckets = hashBits + 1 // Number of buckets - maxBondingPingPongs = 16 + //maxBondingPingPongs = 16 maxFindnodeFailures = 5 ) diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go index 6ce72d2c152b..0a5b91bb84ad 100644 --- a/p2p/discv5/udp.go +++ b/p2p/discv5/udp.go @@ -36,25 +36,25 @@ const Version = 4 // Errors var ( - errPacketTooSmall = errors.New("too small") - errBadPrefix = errors.New("bad prefix") - errExpired = errors.New("expired") - errUnsolicitedReply = errors.New("unsolicited reply") - errUnknownNode = errors.New("unknown node") - errTimeout = errors.New("RPC timeout") - errClockWarp = errors.New("reply deadline too far in the future") - errClosed = errors.New("socket closed") + errPacketTooSmall = errors.New("too small") + errBadPrefix = errors.New("bad prefix") + //errExpired = errors.New("expired") + //errUnsolicitedReply = errors.New("unsolicited reply") + //errUnknownNode = errors.New("unknown node") + errTimeout = errors.New("RPC timeout") + //errClockWarp = errors.New("reply deadline too far in the future") + //errClosed = errors.New("socket closed") ) // Timeouts const ( respTimeout = 500 * time.Millisecond - queryDelay = 1000 * time.Millisecond - expiration = 20 * time.Second + //queryDelay = 1000 * time.Millisecond + expiration = 20 * time.Second - ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP - ntpWarningCooldown = 10 * time.Minute // Minimum amount of time to pass before repeating NTP warning - driftThreshold = 10 * time.Second // Allowed clock drift before warning user + //ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP + //ntpWarningCooldown = 10 * time.Minute // Minimum amount of time to pass before repeating NTP warning + driftThreshold = 10 * time.Second // Allowed clock drift before warning user ) // RPC request structures diff --git a/p2p/discv5/udp_test.go b/p2p/discv5/udp_test.go index 7d31815947cf..4a529cd8362c 100644 --- a/p2p/discv5/udp_test.go +++ b/p2p/discv5/udp_test.go @@ -24,9 +24,9 @@ import ( "reflect" "sync" "testing" - "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" @@ -38,11 +38,11 @@ func init() { // shared test variables var ( - futureExp = uint64(time.Now().Add(10 * time.Hour).Unix()) - testTarget = NodeID{0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1} - testRemote = rpcEndpoint{IP: net.ParseIP("1.1.1.1").To4(), UDP: 1, TCP: 2} - testLocalAnnounced = rpcEndpoint{IP: net.ParseIP("2.2.2.2").To4(), UDP: 3, TCP: 4} - testLocal = rpcEndpoint{IP: net.ParseIP("3.3.3.3").To4(), UDP: 5, TCP: 6} + //futureExp = uint64(time.Now().Add(10 * time.Hour).Unix()) + //testTarget = NodeID{0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1} + //testRemote = rpcEndpoint{IP: net.ParseIP("1.1.1.1").To4(), UDP: 1, TCP: 2} + //testLocalAnnounced = rpcEndpoint{IP: net.ParseIP("2.2.2.2").To4(), UDP: 3, TCP: 4} + testLocal = rpcEndpoint{IP: net.ParseIP("3.3.3.3").To4(), UDP: 5, TCP: 6} ) // type udpTest struct { diff --git a/p2p/enr/enr.go b/p2p/enr/enr.go index 2c3afb43e996..15aae6c81904 100644 --- a/p2p/enr/enr.go +++ b/p2p/enr/enr.go @@ -45,8 +45,8 @@ const SizeLimit = 300 // maximum encoded size of a node record in bytes const ID_SECP256k1_KECCAK = ID("secp256k1-keccak") // the default identity scheme var ( - errNoID = errors.New("unknown or unspecified identity scheme") - errInvalidSigsize = errors.New("invalid signature size") + errNoID = errors.New("unknown or unspecified identity scheme") + //errInvalidSigsize = errors.New("invalid signature size") errInvalidSig = errors.New("invalid signature") errNotSorted = errors.New("record key/value pairs are not sorted by key") errDuplicateKey = errors.New("record contains duplicate key") diff --git a/p2p/enr/enr_test.go b/p2p/enr/enr_test.go index ce7767d105af..f4c048a5e073 100644 --- a/p2p/enr/enr_test.go +++ b/p2p/enr/enr_test.go @@ -24,10 +24,11 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/rlp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index a254648c66b8..da889047022a 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -25,8 +25,9 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum/log" "github.com/jackpal/go-nat-pmp" + + "github.com/ethereum/go-ethereum/log" ) // An implementation of nat.Interface can map local ports to ports diff --git a/p2p/peer.go b/p2p/peer.go index 477d8c219048..cab631d7c6cf 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -47,8 +47,8 @@ const ( discMsg = 0x01 pingMsg = 0x02 pongMsg = 0x03 - getPeersMsg = 0x04 - peersMsg = 0x05 + //getPeersMsg = 0x04 + //peersMsg = 0x05 ) // protoHandshake is the RLP structure of the protocol handshake. diff --git a/p2p/rlpx.go b/p2p/rlpx.go index a320e81e7c02..6870a532c55a 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -35,13 +35,14 @@ import ( "sync" "time" + "github.com/golang/snappy" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/crypto/sha3" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/rlp" - "github.com/golang/snappy" ) const ( diff --git a/p2p/rlpx_test.go b/p2p/rlpx_test.go index bca460402164..b6b91d093715 100644 --- a/p2p/rlpx_test.go +++ b/p2p/rlpx_test.go @@ -31,6 +31,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/crypto/sha3" diff --git a/p2p/simulations/adapters/docker.go b/p2p/simulations/adapters/docker.go index 8ef5629fb5fb..c92d5a5431c5 100644 --- a/p2p/simulations/adapters/docker.go +++ b/p2p/simulations/adapters/docker.go @@ -28,6 +28,7 @@ import ( "strings" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p/discover" diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index a566fb27d8f1..9642c1628f40 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -36,12 +36,13 @@ import ( "time" "github.com/docker/docker/pkg/reexec" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/rpc" - "golang.org/x/net/websocket" ) // ExecAdapter is a NodeAdapter which runs simulation nodes by executing the diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index 5b4b47fe2f80..e5216f2e7420 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -25,6 +25,7 @@ import ( "os" "github.com/docker/docker/pkg/reexec" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index 97dd742e8893..a28b6e70c822 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,13 +29,14 @@ import ( "strings" "sync" + "github.com/julienschmidt/httprouter" + "golang.org/x/net/websocket" + "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" - "github.com/julienschmidt/httprouter" - "golang.org/x/net/websocket" ) // DefaultClient is the default simulation API client which expects the API diff --git a/rpc/client_test.go b/rpc/client_test.go index 4f354d389e74..8125ba8596ad 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -31,6 +31,7 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/log" ) diff --git a/rpc/server.go b/rpc/server.go index 11373b504cc4..83e2159f8c92 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -25,8 +25,9 @@ import ( "sync" "sync/atomic" - "github.com/ethereum/go-ethereum/log" "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/log" ) const MetadataApi = "rpc" diff --git a/rpc/types.go b/rpc/types.go index f2375604ed95..3220a863888c 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -23,8 +23,9 @@ import ( "strings" "sync" - "github.com/ethereum/go-ethereum/common/hexutil" "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/common/hexutil" ) // API describes the set of methods offered over the RPC interface diff --git a/rpc/websocket.go b/rpc/websocket.go index a6e1cec28a50..a95cdb145e55 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -29,9 +29,10 @@ import ( "strings" "time" - "github.com/ethereum/go-ethereum/log" "golang.org/x/net/websocket" "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/log" ) // websocketJSONCodec is a custom JSON codec with payload size enforcement and diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go index b8e7436cf066..1c8f05bdd18c 100644 --- a/swarm/api/http/server.go +++ b/swarm/api/http/server.go @@ -35,12 +35,13 @@ import ( "strings" "time" + "github.com/rs/cors" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/swarm/api" "github.com/ethereum/go-ethereum/swarm/storage" - "github.com/rs/cors" ) //setup metrics diff --git a/swarm/fuse/fuse_dir.go b/swarm/fuse/fuse_dir.go index 91b236ae8af0..a7701985ebb6 100644 --- a/swarm/fuse/fuse_dir.go +++ b/swarm/fuse/fuse_dir.go @@ -19,12 +19,13 @@ package fuse import ( - "bazil.org/fuse" - "bazil.org/fuse/fs" - "golang.org/x/net/context" "os" "path/filepath" "sync" + + "bazil.org/fuse" + "bazil.org/fuse/fs" + "golang.org/x/net/context" ) var ( diff --git a/swarm/fuse/fuse_file.go b/swarm/fuse/fuse_file.go index c94a0773f525..f45bf0b377dc 100644 --- a/swarm/fuse/fuse_file.go +++ b/swarm/fuse/fuse_file.go @@ -26,9 +26,10 @@ import ( "bazil.org/fuse" "bazil.org/fuse/fs" + "golang.org/x/net/context" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" - "golang.org/x/net/context" ) const ( diff --git a/swarm/fuse/swarmfs.go b/swarm/fuse/swarmfs.go index 2493bdab19ba..e56d0ad4e39e 100644 --- a/swarm/fuse/swarmfs.go +++ b/swarm/fuse/swarmfs.go @@ -17,9 +17,10 @@ package fuse import ( - "github.com/ethereum/go-ethereum/swarm/api" "sync" "time" + + "github.com/ethereum/go-ethereum/swarm/api" ) const ( diff --git a/swarm/fuse/swarmfs_unix.go b/swarm/fuse/swarmfs_unix.go index 75742845a24f..62a15e780bb7 100644 --- a/swarm/fuse/swarmfs_unix.go +++ b/swarm/fuse/swarmfs_unix.go @@ -29,6 +29,7 @@ import ( "bazil.org/fuse" "bazil.org/fuse/fs" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/api" diff --git a/swarm/metrics/flags.go b/swarm/metrics/flags.go index 48b231b219be..e74c1a13067f 100644 --- a/swarm/metrics/flags.go +++ b/swarm/metrics/flags.go @@ -19,11 +19,12 @@ package metrics import ( "time" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/log" gethmetrics "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics/influxdb" - "gopkg.in/urfave/cli.v1" ) var ( diff --git a/swarm/network/syncdb.go b/swarm/network/syncdb.go index 88b4b68dd0f5..7c7a4bf68647 100644 --- a/swarm/network/syncdb.go +++ b/swarm/network/syncdb.go @@ -20,10 +20,11 @@ import ( "encoding/binary" "fmt" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/swarm/storage" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/iterator" + + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/swarm/storage" ) const counterKeyPrefix = 0x01 diff --git a/swarm/storage/database.go b/swarm/storage/database.go index 2532490cc9cb..1bf3bb4c5b6a 100644 --- a/swarm/storage/database.go +++ b/swarm/storage/database.go @@ -22,10 +22,11 @@ package storage import ( "fmt" - "github.com/ethereum/go-ethereum/compression/rle" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" + + "github.com/ethereum/go-ethereum/compression/rle" ) const openFileLimit = 128 diff --git a/swarm/storage/dbstore.go b/swarm/storage/dbstore.go index 421bb061d523..a1ea023a60ac 100644 --- a/swarm/storage/dbstore.go +++ b/swarm/storage/dbstore.go @@ -32,11 +32,12 @@ import ( "io/ioutil" "sync" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/iterator" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/rlp" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/iterator" ) //metrics variables @@ -54,7 +55,7 @@ const ( // key prefixes for leveldb storage kpIndex = 0 - kpData = 1 + //kpData = 1 ) var ( diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 5d4f17deb19a..186670a76283 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -84,8 +84,8 @@ func NewNetStore(hash SwarmHasher, lstore *LocalStore, cloud CloudStore, params } const ( - // maximum number of peers that a retrieved message is delivered to - requesterCount = 3 +// maximum number of peers that a retrieved message is delivered to +//requesterCount = 3 ) var ( diff --git a/trie/sync.go b/trie/sync.go index b573a9f73245..00bc34f40be6 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -20,9 +20,10 @@ import ( "errors" "fmt" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethdb" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) // ErrNotRequested is returned by the trie sync when it's requested to process a diff --git a/trie/trie_test.go b/trie/trie_test.go index 997222628898..b6a79c2d255f 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -30,6 +30,7 @@ import ( "testing/quick" "github.com/davecgh/go-spew/spew" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" diff --git a/vendor/github.com/robertkrimen/otto/ast/comments.go b/vendor/github.com/robertkrimen/otto/ast/comments.go index ef2cc3d89b92..5c9485525e72 100644 --- a/vendor/github.com/robertkrimen/otto/ast/comments.go +++ b/vendor/github.com/robertkrimen/otto/ast/comments.go @@ -2,6 +2,7 @@ package ast import ( "fmt" + "github.com/robertkrimen/otto/file" ) diff --git a/vendor/github.com/robertkrimen/otto/result.go b/vendor/github.com/robertkrimen/otto/result.go index 63642e7d039e..a8f9b3b185cd 100644 --- a/vendor/github.com/robertkrimen/otto/result.go +++ b/vendor/github.com/robertkrimen/otto/result.go @@ -1,7 +1,5 @@ package otto -import () - type _resultKind int const ( diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go index 2fe055784644..50f8dc5444b9 100644 --- a/vendor/github.com/stretchr/testify/require/require.go +++ b/vendor/github.com/stretchr/testify/require/require.go @@ -6,10 +6,11 @@ package require import ( - assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" + + assert "github.com/stretchr/testify/assert" ) // Condition uses a Comparison to assert a complex condition. diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go index c59c3c7b475e..cee247f19bfc 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/vendor/github.com/stretchr/testify/require/require_forward.go @@ -6,10 +6,11 @@ package require import ( - assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" + + assert "github.com/stretchr/testify/assert" ) // Condition uses a Comparison to assert a complex condition. diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/storage.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage.go index d45fb5dfeb14..6eebc25446fa 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/storage.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/storage.go @@ -1,8 +1,9 @@ package leveldb import ( - "github.com/syndtr/goleveldb/leveldb/storage" "sync/atomic" + + "github.com/syndtr/goleveldb/leveldb/storage" ) type iStorage struct { diff --git a/vendor/golang.org/x/crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go index 592d18643617..ab86e8c07219 100644 --- a/vendor/golang.org/x/crypto/openpgp/armor/armor.go +++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go @@ -10,8 +10,9 @@ import ( "bufio" "bytes" "encoding/base64" - "golang.org/x/crypto/openpgp/errors" "io" + + "golang.org/x/crypto/openpgp/errors" ) // A Block represents an OpenPGP armored structure. diff --git a/vendor/golang.org/x/crypto/openpgp/packet/compressed.go b/vendor/golang.org/x/crypto/openpgp/packet/compressed.go index e8f0b5caa7df..6a719dfcea82 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/compressed.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/compressed.go @@ -8,9 +8,10 @@ import ( "compress/bzip2" "compress/flate" "compress/zlib" - "golang.org/x/crypto/openpgp/errors" "io" "strconv" + + "golang.org/x/crypto/openpgp/errors" ) // Compressed represents a compressed OpenPGP packet. The decompressed contents diff --git a/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go b/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go index 1713503395e3..eb6a31bc6ab7 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go @@ -7,10 +7,11 @@ package packet import ( "crypto" "encoding/binary" - "golang.org/x/crypto/openpgp/errors" - "golang.org/x/crypto/openpgp/s2k" "io" "strconv" + + "golang.org/x/crypto/openpgp/errors" + "golang.org/x/crypto/openpgp/s2k" ) // OnePassSignature represents a one-pass signature packet. See RFC 4880, diff --git a/vendor/golang.org/x/crypto/openpgp/packet/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go index 3eded93f042d..f5183d4e6bc0 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/packet.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/packet.go @@ -11,10 +11,11 @@ import ( "crypto/aes" "crypto/cipher" "crypto/des" - "golang.org/x/crypto/cast5" - "golang.org/x/crypto/openpgp/errors" "io" "math/big" + + "golang.org/x/crypto/cast5" + "golang.org/x/crypto/openpgp/errors" ) // readFull is the same as io.ReadFull except that reading zero bytes returns diff --git a/vendor/golang.org/x/crypto/openpgp/packet/reader.go b/vendor/golang.org/x/crypto/openpgp/packet/reader.go index 34bc7c613e6e..2a4ac8500802 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/reader.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/reader.go @@ -5,8 +5,9 @@ package packet import ( - "golang.org/x/crypto/openpgp/errors" "io" + + "golang.org/x/crypto/openpgp/errors" ) // Reader reads packets from an io.Reader and allows packets to be 'unread' so diff --git a/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go b/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go index 6126030eb903..789a27dca7b0 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go @@ -8,10 +8,11 @@ import ( "crypto/cipher" "crypto/sha1" "crypto/subtle" - "golang.org/x/crypto/openpgp/errors" "hash" "io" "strconv" + + "golang.org/x/crypto/openpgp/errors" ) // SymmetricallyEncrypted represents a symmetrically encrypted byte string. The diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go index a2e1b57dc148..5dafc5a8afc0 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go @@ -7,9 +7,10 @@ package terminal // import "golang.org/x/crypto/ssh/terminal" import ( - "golang.org/x/sys/unix" "io" "syscall" + + "golang.org/x/sys/unix" ) // State contains the state of a terminal. diff --git a/vendor/gopkg.in/check.v1/benchmark.go b/vendor/gopkg.in/check.v1/benchmark.go index 46ea9dc6dad6..b2d351948d22 100644 --- a/vendor/gopkg.in/check.v1/benchmark.go +++ b/vendor/gopkg.in/check.v1/benchmark.go @@ -1,9 +1,9 @@ // Copyright (c) 2012 The Go Authors. All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: -// +// // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above @@ -13,7 +13,7 @@ // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR diff --git a/whisper/mailserver/mailserver.go b/whisper/mailserver/mailserver.go index 57e6505ad16c..2866dcf9661b 100644 --- a/whisper/mailserver/mailserver.go +++ b/whisper/mailserver/mailserver.go @@ -20,14 +20,15 @@ import ( "encoding/binary" "fmt" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/util" + "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/util" ) type WMailServer struct { diff --git a/whisper/whisperv5/api.go b/whisper/whisperv5/api.go index ee566625c94d..bdc313fb0d4f 100644 --- a/whisper/whisperv5/api.go +++ b/whisper/whisperv5/api.go @@ -33,7 +33,7 @@ import ( ) const ( - filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds +//filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds ) var ( diff --git a/whisper/whisperv5/peer.go b/whisper/whisperv5/peer.go index 179c93179514..1e19cabad2ae 100644 --- a/whisper/whisperv5/peer.go +++ b/whisper/whisperv5/peer.go @@ -20,11 +20,12 @@ import ( "fmt" "time" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" - set "gopkg.in/fatih/set.v0" ) // peer represents a whisper protocol peer connection. diff --git a/whisper/whisperv5/whisper.go b/whisper/whisperv5/whisper.go index 85849ccce493..90d56a576130 100644 --- a/whisper/whisperv5/whisper.go +++ b/whisper/whisperv5/whisper.go @@ -26,15 +26,16 @@ import ( "sync" "time" + "github.com/syndtr/goleveldb/leveldb/errors" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/sync/syncmap" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" - "github.com/syndtr/goleveldb/leveldb/errors" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/sync/syncmap" - set "gopkg.in/fatih/set.v0" ) type Statistics struct { diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index 3f3a082afe97..9eaf98fb8d88 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -33,7 +33,7 @@ import ( ) const ( - filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds +//filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds ) // List of errors diff --git a/whisper/whisperv6/api_test.go b/whisper/whisperv6/api_test.go index 004a41c9496a..295f8dab0301 100644 --- a/whisper/whisperv6/api_test.go +++ b/whisper/whisperv6/api_test.go @@ -22,8 +22,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" set "gopkg.in/fatih/set.v0" + + "github.com/ethereum/go-ethereum/common" ) func TestMultipleTopicCopyInNewMessageFilter(t *testing.T) { diff --git a/whisper/whisperv6/benchmarks_test.go b/whisper/whisperv6/benchmarks_test.go index 0473179da5a5..d97ee02c1b3e 100644 --- a/whisper/whisperv6/benchmarks_test.go +++ b/whisper/whisperv6/benchmarks_test.go @@ -20,8 +20,9 @@ import ( "crypto/sha256" "testing" - "github.com/ethereum/go-ethereum/crypto" "golang.org/x/crypto/pbkdf2" + + "github.com/ethereum/go-ethereum/crypto" ) func BenchmarkDeriveKeyMaterial(b *testing.B) { diff --git a/whisper/whisperv6/peer.go b/whisper/whisperv6/peer.go index 2bf1c905b232..3b39bae443f1 100644 --- a/whisper/whisperv6/peer.go +++ b/whisper/whisperv6/peer.go @@ -22,11 +22,12 @@ import ( "sync" "time" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" - set "gopkg.in/fatih/set.v0" ) // Peer represents a whisper protocol peer connection. diff --git a/whisper/whisperv6/whisper.go b/whisper/whisperv6/whisper.go index 880cced09897..455d9c9b1001 100644 --- a/whisper/whisperv6/whisper.go +++ b/whisper/whisperv6/whisper.go @@ -26,16 +26,17 @@ import ( "sync" "time" + "github.com/syndtr/goleveldb/leveldb/errors" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/sync/syncmap" + set "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" - "github.com/syndtr/goleveldb/leveldb/errors" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/sync/syncmap" - set "gopkg.in/fatih/set.v0" ) // Statistics holds several message-related counter for analytics diff --git a/whisper/whisperv6/whisper_test.go b/whisper/whisperv6/whisper_test.go index 7fe256309e61..86d0592b34ef 100644 --- a/whisper/whisperv6/whisper_test.go +++ b/whisper/whisperv6/whisper_test.go @@ -24,8 +24,9 @@ import ( "testing" "time" - "github.com/ethereum/go-ethereum/common" "golang.org/x/crypto/pbkdf2" + + "github.com/ethereum/go-ethereum/common" ) func TestWhisperBasic(t *testing.T) { From 9671bfcaa0caccbb9b66457538dcd8bdcac2274a Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Thu, 5 Apr 2018 15:00:20 +0200 Subject: [PATCH 04/15] add varcheck add vendorcheck add goimports add lint coverage on tests example_test turned into actual test add small check on np const to avoid lint varcheck err update travis task to use lint remove lint task contents from makefile --- .travis.yml | 3 +-- Makefile | 10 ++-------- build/ci.go | 7 ++++++- crypto/bn256/cloudflare/constants.go | 2 +- crypto/bn256/cloudflare/example_test.go | 10 +++++++++- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8a97bcd35e47..a2cec08157da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,7 @@ matrix: - sudo chown root:$USER /etc/fuse.conf - go run build/ci.go install - go run build/ci.go test -coverage - - make install-linters - - make lint + - go run build/ci.go lint # These are the latest Go versions. - os: linux diff --git a/Makefile b/Makefile index a13fe497ba50..325f7241c41c 100644 --- a/Makefile +++ b/Makefile @@ -38,15 +38,9 @@ test: all build/env.sh go run build/ci.go test lint: ## Run linters. Use make install-linters first. - vendorcheck ./... - gometalinter --disable-all -E vet -E goimports -E varcheck -E gofmt -E misspell -E goconst -E unconvert -E gosimple --deadline=10m --min-occurrences=6 --tests --vendor ./... + build/env.sh go run build/ci.go lint -install-linters: ## Install linters - go get -u github.com/FiloSottile/vendorcheck - go get -u github.com/alecthomas/gometalinter - gometalinter --vendored-linters --install - -format: # Formats the code. Must have goimports installed (use make install-linters). +format: # Formats the code. Must have goimports installed goimports -w -local github.com/ethereum/go-ethereum ./ clean: diff --git a/build/ci.go b/build/ci.go index 1881a596e9ad..f74f0a902af6 100644 --- a/build/ci.go +++ b/build/ci.go @@ -324,12 +324,17 @@ func doLint(cmdline []string) { } // Get metalinter and install all supported linters build.MustRun(goTool("get", "gopkg.in/alecthomas/gometalinter.v2")) + build.MustRun(goTool("get", "github.com/FiloSottile/vendorcheck")) + + build.MustRunCommand(filepath.Join(GOBIN, "vendorcheck"), "./...") build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), "--install") // Run fast linters batched together configs := []string{ "--vendor", "--disable-all", + "--enable=goimports", + "--enable=varcheck", "--enable=vet", "--enable=gofmt", "--enable=misspell", @@ -340,7 +345,7 @@ func doLint(cmdline []string) { // Run slow linters one by one for _, linter := range []string{"unconvert", "gosimple"} { - configs = []string{"--vendor", "--deadline=10m", "--disable-all", "--enable=" + linter} + configs = []string{"--vendor", "--tests", "--deadline=10m", "--disable-all", "--enable=" + linter} build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), append(configs, packages...)...) } } diff --git a/crypto/bn256/cloudflare/constants.go b/crypto/bn256/cloudflare/constants.go index 97874bb760ae..5122aae64f1e 100644 --- a/crypto/bn256/cloudflare/constants.go +++ b/crypto/bn256/cloudflare/constants.go @@ -26,7 +26,7 @@ var P = bigFromBase10("218882428718392752222464057452572750886963111572978236626 var p2 = [4]uint64{0x3c208c16d87cfd47, 0x97816a916871ca8d, 0xb85045b68181585d, 0x30644e72e131a029} // np is the negative inverse of p, mod 2^256. -//var np = [4]uint64{0x87d20782e4866389, 0x9ede7d651eca6ac9, 0xd8afcbd01833da80, 0xf57a22b791888c6b} +var np = [4]uint64{0x87d20782e4866389, 0x9ede7d651eca6ac9, 0xd8afcbd01833da80, 0xf57a22b791888c6b} // rN1 is R^-1 where R = 2^256 mod p. var rN1 = &gfP{0xed84884a014afa37, 0xeb2022850278edf8, 0xcf63e9cfb74492d9, 0x2e67157159e5c639} diff --git a/crypto/bn256/cloudflare/example_test.go b/crypto/bn256/cloudflare/example_test.go index b2d19807a25e..6c285995cb22 100644 --- a/crypto/bn256/cloudflare/example_test.go +++ b/crypto/bn256/cloudflare/example_test.go @@ -6,9 +6,12 @@ package bn256 import ( "crypto/rand" + "testing" + + "github.com/stretchr/testify/require" ) -func ExamplePair() { +func TestExamplePair(t *testing.T) { // This implements the tripartite Diffie-Hellman algorithm from "A One // Round Protocol for Tripartite Diffie-Hellman", A. Joux. // http://www.springerlink.com/content/cddc57yyva0hburb/fulltext.pdf @@ -40,4 +43,9 @@ func ExamplePair() { k3.ScalarMult(k3, c) // k1, k2 and k3 will all be equal. + + require.Equal(t, k1, k2) + require.Equal(t, k1, k3) + + require.Equal(t, len(np), 4) //Avoid gometalinter varcheck err on np } From a48f2a45b9bcf936c1e47ce61b9489686b31ac84 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Thu, 5 Apr 2018 16:36:08 +0200 Subject: [PATCH 05/15] Merge branch 'master' of github.com:ethereum/go-ethereum # Conflicts: # internal/ethapi/api.go --- accounts/abi/bind/backend.go | 1 - accounts/abi/bind/backends/simulated.go | 1 - accounts/abi/bind/base.go | 1 - accounts/keystore/account_cache.go | 2 -- cmd/ethkey/generate.go | 1 - cmd/ethkey/inspect.go | 2 -- cmd/ethkey/main.go | 2 -- cmd/ethkey/message.go | 2 -- cmd/ethkey/utils.go | 2 -- cmd/evm/main.go | 2 -- cmd/geth/accountcmd.go | 2 -- cmd/geth/chaincmd.go | 1 - cmd/geth/consolecmd.go | 2 -- cmd/geth/main.go | 2 -- cmd/geth/misccmd.go | 2 -- cmd/geth/monitorcmd.go | 1 - cmd/geth/usage.go | 2 -- cmd/p2psim/main.go | 2 -- cmd/puppeth/puppeth.go | 2 -- cmd/swarm/db.go | 2 -- cmd/swarm/hash.go | 2 -- cmd/swarm/list.go | 2 -- cmd/swarm/main.go | 2 -- cmd/swarm/manifest.go | 2 -- cmd/swarm/upload.go | 2 -- cmd/utils/customflags.go | 2 -- cmd/utils/flags.go | 2 -- console/console.go | 1 - core/blockchain.go | 1 - core/headerchain.go | 2 -- eth/peer.go | 2 -- ethclient/ethclient.go | 1 - ethclient/ethclient_test.go | 2 -- internal/debug/flags.go | 1 - internal/ethapi/api.go | 3 +++ light/lightchain.go | 2 -- miner/worker.go | 2 -- p2p/nat/nat.go | 2 -- p2p/nat/natpmp.go | 2 -- rpc/ipc_windows.go | 2 -- rpc/server.go | 2 -- rpc/types.go | 2 -- rpc/websocket.go | 1 - swarm/metrics/flags.go | 2 -- vendor/github.com/Azure/go-autorest/autorest/azure/token.go | 1 - vendor/github.com/StackExchange/wmi/swbemservices.go | 1 - vendor/github.com/StackExchange/wmi/wmi.go | 1 - vendor/github.com/fatih/color/color.go | 3 --- vendor/github.com/gizak/termui/events.go | 2 -- vendor/github.com/gizak/termui/textbuilder.go | 2 -- vendor/github.com/mattn/go-colorable/colorable_windows.go | 2 -- vendor/github.com/nsf/termbox-go/api.go | 1 - vendor/github.com/nsf/termbox-go/termbox_windows.go | 1 - vendor/github.com/olekukonko/tablewriter/util.go | 2 -- vendor/github.com/robertkrimen/otto/file/file.go | 2 -- vendor/github.com/robertkrimen/otto/parser/parser.go | 1 - whisper/shhclient/client.go | 1 - 57 files changed, 3 insertions(+), 95 deletions(-) diff --git a/accounts/abi/bind/backend.go b/accounts/abi/bind/backend.go index ca60cc1b4320..0eab5aea3f7f 100644 --- a/accounts/abi/bind/backend.go +++ b/accounts/abi/bind/backend.go @@ -21,7 +21,6 @@ import ( "errors" "math/big" - "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index 2b5c5fc4a4f7..337f8935184a 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -24,7 +24,6 @@ import ( "sync" "time" - "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 83ad1c8ae7fc..a8c2b7ff51d6 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -22,7 +22,6 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 95c4dec26889..0d0238638a18 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -27,8 +27,6 @@ import ( "sync" "time" - "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index b4d22613bd5b..f81c63baa451 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -24,7 +24,6 @@ import ( "path/filepath" "github.com/pborman/uuid" - "gopkg.in/urfave/cli.v1" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" diff --git a/cmd/ethkey/inspect.go b/cmd/ethkey/inspect.go index fdb7d2d95d16..c8a8e7df563c 100644 --- a/cmd/ethkey/inspect.go +++ b/cmd/ethkey/inspect.go @@ -21,8 +21,6 @@ import ( "fmt" "io/ioutil" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/crypto" diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index 17b449739616..201f0120f99f 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -20,8 +20,6 @@ import ( "fmt" "os" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" ) diff --git a/cmd/ethkey/message.go b/cmd/ethkey/message.go index 5535757d9fd8..db21c6b20b4c 100644 --- a/cmd/ethkey/message.go +++ b/cmd/ethkey/message.go @@ -21,8 +21,6 @@ import ( "fmt" "io/ioutil" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" diff --git a/cmd/ethkey/utils.go b/cmd/ethkey/utils.go index 8f0f019fc6ee..81dfcdcfba41 100644 --- a/cmd/ethkey/utils.go +++ b/cmd/ethkey/utils.go @@ -22,8 +22,6 @@ import ( "io/ioutil" "strings" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/crypto" diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 1994c08a1820..64e9457a9ea0 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -22,8 +22,6 @@ import ( "math/big" "os" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" ) diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index 2d6cd5ca9511..586e286ad75d 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -20,8 +20,6 @@ import ( "fmt" "io/ioutil" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 9336c614f45b..ea5e52fa6fa6 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -26,7 +26,6 @@ import ( "time" "github.com/syndtr/goleveldb/leveldb/util" - "gopkg.in/urfave/cli.v1" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index 9d52f27dbfe1..c8d0cc4197fe 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -24,8 +24,6 @@ import ( "strings" "syscall" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/node" diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 3bccb0666be3..9c9fb557ec77 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -25,8 +25,6 @@ import ( "strings" "time" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index 3106075808d1..179e2046bbb5 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -23,8 +23,6 @@ import ( "strconv" "strings" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/eth" diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go index 5f0f5cbd6791..e188fc977132 100644 --- a/cmd/geth/monitorcmd.go +++ b/cmd/geth/monitorcmd.go @@ -26,7 +26,6 @@ import ( "time" "github.com/gizak/termui" - "gopkg.in/urfave/cli.v1" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/node" diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 5378bdc935bc..abadd66d6414 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -24,8 +24,6 @@ import ( "strings" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/internal/debug" ) diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index 38a54add4e2d..e595a6d84532 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,8 +45,6 @@ import ( "strings" "text/tabwriter" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index 9328f5280bb8..7b32ed45923f 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -23,8 +23,6 @@ import ( "strings" "time" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/log" ) diff --git a/cmd/swarm/db.go b/cmd/swarm/db.go index 4ea97af75cbc..99d275506483 100644 --- a/cmd/swarm/db.go +++ b/cmd/swarm/db.go @@ -22,8 +22,6 @@ import ( "os" "path/filepath" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" diff --git a/cmd/swarm/hash.go b/cmd/swarm/hash.go index b89de1df099e..1423fcf61f20 100644 --- a/cmd/swarm/hash.go +++ b/cmd/swarm/hash.go @@ -21,8 +21,6 @@ import ( "fmt" "os" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/storage" ) diff --git a/cmd/swarm/list.go b/cmd/swarm/list.go index a4dd422187e2..8d5045aef5db 100644 --- a/cmd/swarm/list.go +++ b/cmd/swarm/list.go @@ -22,8 +22,6 @@ import ( "strings" "text/tabwriter" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" swarm "github.com/ethereum/go-ethereum/swarm/api/client" ) diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 360020b77b8c..6ec48b1e6daf 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -44,8 +44,6 @@ import ( "github.com/ethereum/go-ethereum/swarm" bzzapi "github.com/ethereum/go-ethereum/swarm/api" swarmmetrics "github.com/ethereum/go-ethereum/swarm/metrics" - - "gopkg.in/urfave/cli.v1" ) const clientIdentifier = "swarm" diff --git a/cmd/swarm/manifest.go b/cmd/swarm/manifest.go index f286a7e056b4..53ead5ec3637 100644 --- a/cmd/swarm/manifest.go +++ b/cmd/swarm/manifest.go @@ -24,8 +24,6 @@ import ( "path/filepath" "strings" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/api" swarm "github.com/ethereum/go-ethereum/swarm/api/client" diff --git a/cmd/swarm/upload.go b/cmd/swarm/upload.go index b0d587129fa0..28845a4abb4b 100644 --- a/cmd/swarm/upload.go +++ b/cmd/swarm/upload.go @@ -30,8 +30,6 @@ import ( "path/filepath" "strings" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" swarm "github.com/ethereum/go-ethereum/swarm/api/client" ) diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index 06de36666ae2..ff515a651f47 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -27,8 +27,6 @@ import ( "path" "strings" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/common/math" ) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index dadac12d28a9..069170e89b5a 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -28,8 +28,6 @@ import ( "strconv" "strings" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" diff --git a/console/console.go b/console/console.go index cef5d3c7be09..ff640bd824ac 100644 --- a/console/console.go +++ b/console/console.go @@ -28,7 +28,6 @@ import ( "strings" "syscall" - "github.com/mattn/go-colorable" "github.com/peterh/liner" "github.com/robertkrimen/otto" diff --git a/core/blockchain.go b/core/blockchain.go index 48bbf220ee37..e15438e808e0 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -27,7 +27,6 @@ import ( "sync/atomic" "time" - "github.com/hashicorp/golang-lru" "gopkg.in/karalabe/cookiejar.v2/collections/prque" "github.com/ethereum/go-ethereum/common" diff --git a/core/headerchain.go b/core/headerchain.go index 70dfe6dd20a6..2eecd8bfbe75 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,8 +26,6 @@ import ( "sync/atomic" "time" - "github.com/hashicorp/golang-lru" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" diff --git a/eth/peer.go b/eth/peer.go index 72f1f0e81377..37a534021897 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -23,8 +23,6 @@ import ( "sync" "time" - "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/p2p" diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index 87a912901af5..ab5723957627 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -24,7 +24,6 @@ import ( "fmt" "math/big" - "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index 178eb2be9828..a24b03af0de5 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -16,8 +16,6 @@ package ethclient -import "github.com/ethereum/go-ethereum" - // Verify that Client implements the ethereum interfaces. var ( _ = ethereum.ChainReader(&Client{}) diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 2ef0e07022ea..63149ac99e2c 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -25,7 +25,6 @@ import ( "runtime" colorable "github.com/mattn/go-colorable" - "gopkg.in/urfave/cli.v1" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log/term" diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index d96fe970daf5..876b2c5697b6 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -26,6 +26,9 @@ import ( "time" "github.com/davecgh/go-spew/spew" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/util" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" diff --git a/light/lightchain.go b/light/lightchain.go index e2538b9ac632..b805541e14b7 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -24,8 +24,6 @@ import ( "sync/atomic" "time" - "github.com/hashicorp/golang-lru" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core" diff --git a/miner/worker.go b/miner/worker.go index 1a301bf07404..af49e44b4bc8 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -24,8 +24,6 @@ import ( "sync/atomic" "time" - "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/misc" diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index da889047022a..827595fc4b25 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -25,8 +25,6 @@ import ( "sync" "time" - "github.com/jackpal/go-nat-pmp" - "github.com/ethereum/go-ethereum/log" ) diff --git a/p2p/nat/natpmp.go b/p2p/nat/natpmp.go index 577a424fbec1..b574e78bbef6 100644 --- a/p2p/nat/natpmp.go +++ b/p2p/nat/natpmp.go @@ -21,8 +21,6 @@ import ( "net" "strings" "time" - - "github.com/jackpal/go-nat-pmp" ) // natPMPClient adapts the NAT-PMP protocol implementation so it conforms to diff --git a/rpc/ipc_windows.go b/rpc/ipc_windows.go index ca56a3ce4313..e8761e11fcbf 100644 --- a/rpc/ipc_windows.go +++ b/rpc/ipc_windows.go @@ -22,8 +22,6 @@ import ( "context" "net" "time" - - "gopkg.in/natefinch/npipe.v2" ) // This is used if the dialing context has no deadline. It is much smaller than the diff --git a/rpc/server.go b/rpc/server.go index 83e2159f8c92..34b12f581ab3 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -25,8 +25,6 @@ import ( "sync" "sync/atomic" - "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/log" ) diff --git a/rpc/types.go b/rpc/types.go index 3220a863888c..227568de01a9 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -23,8 +23,6 @@ import ( "strings" "sync" - "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common/hexutil" ) diff --git a/rpc/websocket.go b/rpc/websocket.go index a95cdb145e55..0354af32a241 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -30,7 +30,6 @@ import ( "time" "golang.org/x/net/websocket" - "gopkg.in/fatih/set.v0" "github.com/ethereum/go-ethereum/log" ) diff --git a/swarm/metrics/flags.go b/swarm/metrics/flags.go index e74c1a13067f..00edaebf4262 100644 --- a/swarm/metrics/flags.go +++ b/swarm/metrics/flags.go @@ -19,8 +19,6 @@ package metrics import ( "time" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/log" gethmetrics "github.com/ethereum/go-ethereum/metrics" diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/token.go b/vendor/github.com/Azure/go-autorest/autorest/azure/token.go index cfcd030114c6..b4c03459217f 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/token.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/token.go @@ -13,7 +13,6 @@ import ( "time" "github.com/Azure/go-autorest/autorest" - "github.com/dgrijalva/jwt-go" ) const ( diff --git a/vendor/github.com/StackExchange/wmi/swbemservices.go b/vendor/github.com/StackExchange/wmi/swbemservices.go index 9765a53f74db..18fcca61b3a1 100644 --- a/vendor/github.com/StackExchange/wmi/swbemservices.go +++ b/vendor/github.com/StackExchange/wmi/swbemservices.go @@ -8,7 +8,6 @@ import ( "runtime" "sync" - "github.com/go-ole/go-ole" "github.com/go-ole/go-ole/oleutil" ) diff --git a/vendor/github.com/StackExchange/wmi/wmi.go b/vendor/github.com/StackExchange/wmi/wmi.go index a951b1258b04..33d0e8b47291 100644 --- a/vendor/github.com/StackExchange/wmi/wmi.go +++ b/vendor/github.com/StackExchange/wmi/wmi.go @@ -37,7 +37,6 @@ import ( "sync" "time" - "github.com/go-ole/go-ole" "github.com/go-ole/go-ole/oleutil" ) diff --git a/vendor/github.com/fatih/color/color.go b/vendor/github.com/fatih/color/color.go index 34cd8e4c8ac1..f30e5f50b87b 100644 --- a/vendor/github.com/fatih/color/color.go +++ b/vendor/github.com/fatih/color/color.go @@ -7,9 +7,6 @@ import ( "strconv" "strings" "sync" - - "github.com/mattn/go-colorable" - "github.com/mattn/go-isatty" ) var ( diff --git a/vendor/github.com/gizak/termui/events.go b/vendor/github.com/gizak/termui/events.go index 16d9bd9cc34a..f8cda39d7413 100644 --- a/vendor/github.com/gizak/termui/events.go +++ b/vendor/github.com/gizak/termui/events.go @@ -9,8 +9,6 @@ import ( "strconv" "sync" "time" - - "github.com/nsf/termbox-go" ) type Event struct { diff --git a/vendor/github.com/gizak/termui/textbuilder.go b/vendor/github.com/gizak/termui/textbuilder.go index 12e2055b5095..3c1b6817915e 100644 --- a/vendor/github.com/gizak/termui/textbuilder.go +++ b/vendor/github.com/gizak/termui/textbuilder.go @@ -7,8 +7,6 @@ package termui import ( "regexp" "strings" - - "github.com/mitchellh/go-wordwrap" ) // TextBuilder is a minimal interface to produce text []Cell using specific syntax (markdown). diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/vendor/github.com/mattn/go-colorable/colorable_windows.go index 628ad904e591..88d5b5611a5d 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_windows.go +++ b/vendor/github.com/mattn/go-colorable/colorable_windows.go @@ -9,8 +9,6 @@ import ( "strings" "syscall" "unsafe" - - "github.com/mattn/go-isatty" ) const ( diff --git a/vendor/github.com/nsf/termbox-go/api.go b/vendor/github.com/nsf/termbox-go/api.go index b242ddcf3a23..717c4ad76c87 100644 --- a/vendor/github.com/nsf/termbox-go/api.go +++ b/vendor/github.com/nsf/termbox-go/api.go @@ -2,7 +2,6 @@ package termbox -import "github.com/mattn/go-runewidth" import "fmt" import "os" import "os/signal" diff --git a/vendor/github.com/nsf/termbox-go/termbox_windows.go b/vendor/github.com/nsf/termbox-go/termbox_windows.go index f7dad7b8a5fb..b2c184e69610 100644 --- a/vendor/github.com/nsf/termbox-go/termbox_windows.go +++ b/vendor/github.com/nsf/termbox-go/termbox_windows.go @@ -3,7 +3,6 @@ package termbox import "syscall" import "unsafe" import "unicode/utf16" -import "github.com/mattn/go-runewidth" type ( wchar uint16 diff --git a/vendor/github.com/olekukonko/tablewriter/util.go b/vendor/github.com/olekukonko/tablewriter/util.go index 2deefbc52a0a..a39721d8d50d 100644 --- a/vendor/github.com/olekukonko/tablewriter/util.go +++ b/vendor/github.com/olekukonko/tablewriter/util.go @@ -11,8 +11,6 @@ import ( "math" "regexp" "strings" - - "github.com/mattn/go-runewidth" ) var ansi = regexp.MustCompile("\033\\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]") diff --git a/vendor/github.com/robertkrimen/otto/file/file.go b/vendor/github.com/robertkrimen/otto/file/file.go index 9093206e8e59..7f6bd17fd40a 100644 --- a/vendor/github.com/robertkrimen/otto/file/file.go +++ b/vendor/github.com/robertkrimen/otto/file/file.go @@ -5,8 +5,6 @@ package file import ( "fmt" "strings" - - "gopkg.in/sourcemap.v1" ) // Idx is a compact encoding of a source position within a file set. diff --git a/vendor/github.com/robertkrimen/otto/parser/parser.go b/vendor/github.com/robertkrimen/otto/parser/parser.go index 75b7c500c439..f7fe0aaee347 100644 --- a/vendor/github.com/robertkrimen/otto/parser/parser.go +++ b/vendor/github.com/robertkrimen/otto/parser/parser.go @@ -43,7 +43,6 @@ import ( "github.com/robertkrimen/otto/ast" "github.com/robertkrimen/otto/file" "github.com/robertkrimen/otto/token" - "gopkg.in/sourcemap.v1" ) // A Mode value is a set of flags (or 0). They control optional parser functionality. diff --git a/whisper/shhclient/client.go b/whisper/shhclient/client.go index bbe694baaa1d..c3ce44f25b54 100644 --- a/whisper/shhclient/client.go +++ b/whisper/shhclient/client.go @@ -19,7 +19,6 @@ package shhclient import ( "context" - "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/rpc" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" From dea717b9f4c5ce1a977da20cd949cda9b7bf13d3 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Thu, 5 Apr 2018 21:02:25 +0200 Subject: [PATCH 06/15] goimports incorrectly removed valid imports, manually restoring all files to original state add task for format only as this is blocking lint validations update linters to also lint test files --- Makefile | 2 +- accounts/abi/bind/backend.go | 1 + accounts/abi/bind/backends/simulated.go | 1 + accounts/abi/bind/base.go | 1 + accounts/abi/bind/bind.go | 3 +-- accounts/keystore/account_cache.go | 2 ++ accounts/keystore/file_cache.go | 3 +-- build/ci.go | 1 + build/gofmt.sh | 16 ++++++++++++++++ cmd/ethkey/generate.go | 1 + cmd/ethkey/inspect.go | 1 + cmd/ethkey/main.go | 1 + cmd/ethkey/message.go | 1 + cmd/ethkey/utils.go | 1 + cmd/evm/main.go | 1 + cmd/geth/accountcmd.go | 1 + cmd/geth/chaincmd.go | 4 ++-- cmd/geth/consolecmd.go | 1 + cmd/geth/main.go | 1 + cmd/geth/misccmd.go | 1 + cmd/geth/monitorcmd.go | 4 ++-- cmd/geth/usage.go | 1 + cmd/p2psim/main.go | 2 ++ cmd/puppeth/puppeth.go | 1 + cmd/swarm/db.go | 1 + cmd/swarm/hash.go | 1 + cmd/swarm/list.go | 1 + cmd/swarm/main.go | 2 ++ cmd/swarm/manifest.go | 1 + cmd/swarm/upload.go | 1 + cmd/utils/customflags.go | 1 + cmd/utils/flags.go | 1 + console/console.go | 1 + core/blockchain.go | 4 ++-- core/headerchain.go | 2 ++ eth/peer.go | 1 + ethclient/ethclient.go | 1 + ethclient/ethclient_test.go | 2 ++ internal/debug/flags.go | 1 + light/lightchain.go | 1 + miner/worker.go | 1 + p2p/nat/nat.go | 1 + p2p/nat/natpmp.go | 2 ++ rpc/ipc_windows.go | 2 ++ rpc/server.go | 1 + rpc/types.go | 1 + rpc/websocket.go | 1 + swarm/metrics/flags.go | 1 + .../Azure/go-autorest/autorest/azure/token.go | 1 + .../StackExchange/wmi/swbemservices.go | 1 + vendor/github.com/StackExchange/wmi/wmi.go | 1 + vendor/github.com/fatih/color/color.go | 3 +++ vendor/github.com/gizak/termui/events.go | 2 ++ vendor/github.com/gizak/termui/textbuilder.go | 2 ++ .../mattn/go-colorable/colorable_windows.go | 2 ++ vendor/github.com/nsf/termbox-go/api.go | 1 + .../github.com/nsf/termbox-go/termbox_windows.go | 1 + vendor/github.com/olekukonko/tablewriter/util.go | 2 ++ .../github.com/robertkrimen/otto/ast/comments.go | 1 - vendor/github.com/robertkrimen/otto/file/file.go | 2 ++ .../robertkrimen/otto/parser/parser.go | 1 + vendor/github.com/robertkrimen/otto/result.go | 2 ++ .../stretchr/testify/require/require.go | 3 +-- .../stretchr/testify/require/require_forward.go | 3 +-- .../syndtr/goleveldb/leveldb/storage.go | 3 +-- .../golang.org/x/crypto/openpgp/armor/armor.go | 3 +-- .../x/crypto/openpgp/packet/compressed.go | 3 +-- .../crypto/openpgp/packet/one_pass_signature.go | 5 ++--- .../golang.org/x/crypto/openpgp/packet/packet.go | 5 ++--- .../golang.org/x/crypto/openpgp/packet/reader.go | 3 +-- .../openpgp/packet/symmetrically_encrypted.go | 3 +-- .../x/crypto/ssh/terminal/util_solaris.go | 3 +-- vendor/gopkg.in/check.v1/benchmark.go | 6 +++--- whisper/shhclient/client.go | 1 + 74 files changed, 110 insertions(+), 37 deletions(-) create mode 100755 build/gofmt.sh diff --git a/Makefile b/Makefile index 325f7241c41c..744a3511aa6f 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ lint: ## Run linters. Use make install-linters first. build/env.sh go run build/ci.go lint format: # Formats the code. Must have goimports installed - goimports -w -local github.com/ethereum/go-ethereum ./ + build/gofmt.sh clean: rm -fr build/_workspace/pkg/ $(GOBIN)/* diff --git a/accounts/abi/bind/backend.go b/accounts/abi/bind/backend.go index 0eab5aea3f7f..ca60cc1b4320 100644 --- a/accounts/abi/bind/backend.go +++ b/accounts/abi/bind/backend.go @@ -21,6 +21,7 @@ import ( "errors" "math/big" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" ) diff --git a/accounts/abi/bind/backends/simulated.go b/accounts/abi/bind/backends/simulated.go index 337f8935184a..2b5c5fc4a4f7 100644 --- a/accounts/abi/bind/backends/simulated.go +++ b/accounts/abi/bind/backends/simulated.go @@ -24,6 +24,7 @@ import ( "sync" "time" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index a8c2b7ff51d6..83ad1c8ae7fc 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -22,6 +22,7 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index 6a5c60931353..411177057b97 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -28,9 +28,8 @@ import ( "text/template" "unicode" - "golang.org/x/tools/imports" - "github.com/ethereum/go-ethereum/accounts/abi" + "golang.org/x/tools/imports" ) // Lang is a target programming language selector to generate bindings for. diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 0d0238638a18..95c4dec26889 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -27,6 +27,8 @@ import ( "sync" "time" + "gopkg.in/fatih/set.v0" + "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" diff --git a/accounts/keystore/file_cache.go b/accounts/keystore/file_cache.go index 86aa765a3490..c91b7b7b6104 100644 --- a/accounts/keystore/file_cache.go +++ b/accounts/keystore/file_cache.go @@ -24,9 +24,8 @@ import ( "sync" "time" - set "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/log" + set "gopkg.in/fatih/set.v0" ) // fileCache is a cache of files seen during scan of keystore. diff --git a/build/ci.go b/build/ci.go index f74f0a902af6..9214ebd8c6c4 100644 --- a/build/ci.go +++ b/build/ci.go @@ -332,6 +332,7 @@ func doLint(cmdline []string) { // Run fast linters batched together configs := []string{ "--vendor", + "--tests", "--disable-all", "--enable=goimports", "--enable=varcheck", diff --git a/build/gofmt.sh b/build/gofmt.sh new file mode 100755 index 000000000000..6bc848e20e18 --- /dev/null +++ b/build/gofmt.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +find_files() { + find . -not \( \ + \( \ + -wholename '.github' \ + -o -wholename './build/_workspace' \ + -o -wholename './build/bin' \ + -o -wholename './crypto/bn256' \ + -o -wholename '*/vendor/*' \ + \) -prune \ + \) -name '*.go' +} + +GOFMT="gofmt -s -w"; +find_files | xargs $GOFMT; \ No newline at end of file diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index f81c63baa451..b4d22613bd5b 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -24,6 +24,7 @@ import ( "path/filepath" "github.com/pborman/uuid" + "gopkg.in/urfave/cli.v1" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" diff --git a/cmd/ethkey/inspect.go b/cmd/ethkey/inspect.go index c8a8e7df563c..dbf5afc0cee9 100644 --- a/cmd/ethkey/inspect.go +++ b/cmd/ethkey/inspect.go @@ -24,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/crypto" + "gopkg.in/urfave/cli.v1" ) type outputInspect struct { diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index 201f0120f99f..7543c1efdb30 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -21,6 +21,7 @@ import ( "os" "github.com/ethereum/go-ethereum/cmd/utils" + "gopkg.in/urfave/cli.v1" ) const ( diff --git a/cmd/ethkey/message.go b/cmd/ethkey/message.go index db21c6b20b4c..531a931c82f6 100644 --- a/cmd/ethkey/message.go +++ b/cmd/ethkey/message.go @@ -25,6 +25,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "gopkg.in/urfave/cli.v1" ) type outputSign struct { diff --git a/cmd/ethkey/utils.go b/cmd/ethkey/utils.go index 81dfcdcfba41..0e563bf9225a 100644 --- a/cmd/ethkey/utils.go +++ b/cmd/ethkey/utils.go @@ -25,6 +25,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/crypto" + "gopkg.in/urfave/cli.v1" ) // getPassPhrase obtains a passphrase given by the user. It first checks the diff --git a/cmd/evm/main.go b/cmd/evm/main.go index 64e9457a9ea0..a59cb1fb8430 100644 --- a/cmd/evm/main.go +++ b/cmd/evm/main.go @@ -23,6 +23,7 @@ import ( "os" "github.com/ethereum/go-ethereum/cmd/utils" + "gopkg.in/urfave/cli.v1" ) var gitCommit = "" // Git SHA1 commit hash of the release (set via linker flags) diff --git a/cmd/geth/accountcmd.go b/cmd/geth/accountcmd.go index 586e286ad75d..0db5c4ce0f8e 100644 --- a/cmd/geth/accountcmd.go +++ b/cmd/geth/accountcmd.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" + "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index ea5e52fa6fa6..d3086921b95a 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -25,8 +25,6 @@ import ( "sync/atomic" "time" - "github.com/syndtr/goleveldb/leveldb/util" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" @@ -38,6 +36,8 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/trie" + "github.com/syndtr/goleveldb/leveldb/util" + "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/consolecmd.go b/cmd/geth/consolecmd.go index c8d0cc4197fe..2500a969cf5e 100644 --- a/cmd/geth/consolecmd.go +++ b/cmd/geth/consolecmd.go @@ -28,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/console" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" + "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 9c9fb557ec77..d94154245f1b 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -35,6 +35,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/node" + "gopkg.in/urfave/cli.v1" ) const ( diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index 179e2046bbb5..aa9b1ee568e7 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/params" + "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go index e188fc977132..cd19caa2765c 100644 --- a/cmd/geth/monitorcmd.go +++ b/cmd/geth/monitorcmd.go @@ -25,11 +25,11 @@ import ( "strings" "time" - "github.com/gizak/termui" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/rpc" + "github.com/gizak/termui" + "gopkg.in/urfave/cli.v1" ) var ( diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index abadd66d6414..a1558c2330c9 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -26,6 +26,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/internal/debug" + "gopkg.in/urfave/cli.v1" ) // AppHelpTemplate is the test template for the default, global app help topic. diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index e595a6d84532..38a54add4e2d 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,6 +45,8 @@ import ( "strings" "text/tabwriter" + "gopkg.in/urfave/cli.v1" + "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index 7b32ed45923f..f9b8fe481153 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -24,6 +24,7 @@ import ( "time" "github.com/ethereum/go-ethereum/log" + "gopkg.in/urfave/cli.v1" ) // main is just a boring entry point to set up the CLI app. diff --git a/cmd/swarm/db.go b/cmd/swarm/db.go index 99d275506483..dfd2d069b975 100644 --- a/cmd/swarm/db.go +++ b/cmd/swarm/db.go @@ -25,6 +25,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" + "gopkg.in/urfave/cli.v1" ) func dbExport(ctx *cli.Context) { diff --git a/cmd/swarm/hash.go b/cmd/swarm/hash.go index 1423fcf61f20..792e8d0d7afb 100644 --- a/cmd/swarm/hash.go +++ b/cmd/swarm/hash.go @@ -23,6 +23,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/storage" + "gopkg.in/urfave/cli.v1" ) func hash(ctx *cli.Context) { diff --git a/cmd/swarm/list.go b/cmd/swarm/list.go index 8d5045aef5db..57b5517c6ef5 100644 --- a/cmd/swarm/list.go +++ b/cmd/swarm/list.go @@ -24,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" swarm "github.com/ethereum/go-ethereum/swarm/api/client" + "gopkg.in/urfave/cli.v1" ) func list(ctx *cli.Context) { diff --git a/cmd/swarm/main.go b/cmd/swarm/main.go index 6ec48b1e6daf..360020b77b8c 100644 --- a/cmd/swarm/main.go +++ b/cmd/swarm/main.go @@ -44,6 +44,8 @@ import ( "github.com/ethereum/go-ethereum/swarm" bzzapi "github.com/ethereum/go-ethereum/swarm/api" swarmmetrics "github.com/ethereum/go-ethereum/swarm/metrics" + + "gopkg.in/urfave/cli.v1" ) const clientIdentifier = "swarm" diff --git a/cmd/swarm/manifest.go b/cmd/swarm/manifest.go index 53ead5ec3637..41a69a5d05f3 100644 --- a/cmd/swarm/manifest.go +++ b/cmd/swarm/manifest.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/swarm/api" swarm "github.com/ethereum/go-ethereum/swarm/api/client" + "gopkg.in/urfave/cli.v1" ) const bzzManifestJSON = "application/bzz-manifest+json" diff --git a/cmd/swarm/upload.go b/cmd/swarm/upload.go index 28845a4abb4b..9f4c525bb92a 100644 --- a/cmd/swarm/upload.go +++ b/cmd/swarm/upload.go @@ -32,6 +32,7 @@ import ( "github.com/ethereum/go-ethereum/cmd/utils" swarm "github.com/ethereum/go-ethereum/swarm/api/client" + "gopkg.in/urfave/cli.v1" ) func upload(ctx *cli.Context) { diff --git a/cmd/utils/customflags.go b/cmd/utils/customflags.go index ff515a651f47..e5bf8724c17a 100644 --- a/cmd/utils/customflags.go +++ b/cmd/utils/customflags.go @@ -28,6 +28,7 @@ import ( "strings" "github.com/ethereum/go-ethereum/common/math" + "gopkg.in/urfave/cli.v1" ) // Custom type which is registered in the flags library which cli uses for diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 069170e89b5a..4f3d81f5d2aa 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -56,6 +56,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/netutil" "github.com/ethereum/go-ethereum/params" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "gopkg.in/urfave/cli.v1" ) var ( diff --git a/console/console.go b/console/console.go index ff640bd824ac..cef5d3c7be09 100644 --- a/console/console.go +++ b/console/console.go @@ -28,6 +28,7 @@ import ( "strings" "syscall" + "github.com/mattn/go-colorable" "github.com/peterh/liner" "github.com/robertkrimen/otto" diff --git a/core/blockchain.go b/core/blockchain.go index e15438e808e0..b33eb85a4479 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -27,8 +27,6 @@ import ( "sync/atomic" "time" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/mclock" "github.com/ethereum/go-ethereum/consensus" @@ -43,6 +41,8 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/trie" + "github.com/hashicorp/golang-lru" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) var ( diff --git a/core/headerchain.go b/core/headerchain.go index 2eecd8bfbe75..70dfe6dd20a6 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,6 +26,8 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" diff --git a/eth/peer.go b/eth/peer.go index 37a534021897..42ead539653d 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -27,6 +27,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" + "gopkg.in/fatih/set.v0" ) var ( diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index ab5723957627..87a912901af5 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -24,6 +24,7 @@ import ( "fmt" "math/big" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index a24b03af0de5..178eb2be9828 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -16,6 +16,8 @@ package ethclient +import "github.com/ethereum/go-ethereum" + // Verify that Client implements the ethereum interfaces. var ( _ = ethereum.ChainReader(&Client{}) diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 63149ac99e2c..d928ea71b84b 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -30,6 +30,7 @@ import ( "github.com/ethereum/go-ethereum/log/term" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics/exp" + "gopkg.in/urfave/cli.v1" ) var ( diff --git a/light/lightchain.go b/light/lightchain.go index b805541e14b7..2784615d35d4 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -34,6 +34,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" + "github.com/hashicorp/golang-lru" ) var ( diff --git a/miner/worker.go b/miner/worker.go index af49e44b4bc8..15395ae0b93c 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -35,6 +35,7 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" + "gopkg.in/fatih/set.v0" ) const ( diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index 827595fc4b25..a254648c66b8 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -26,6 +26,7 @@ import ( "time" "github.com/ethereum/go-ethereum/log" + "github.com/jackpal/go-nat-pmp" ) // An implementation of nat.Interface can map local ports to ports diff --git a/p2p/nat/natpmp.go b/p2p/nat/natpmp.go index b574e78bbef6..577a424fbec1 100644 --- a/p2p/nat/natpmp.go +++ b/p2p/nat/natpmp.go @@ -21,6 +21,8 @@ import ( "net" "strings" "time" + + "github.com/jackpal/go-nat-pmp" ) // natPMPClient adapts the NAT-PMP protocol implementation so it conforms to diff --git a/rpc/ipc_windows.go b/rpc/ipc_windows.go index e8761e11fcbf..ca56a3ce4313 100644 --- a/rpc/ipc_windows.go +++ b/rpc/ipc_windows.go @@ -22,6 +22,8 @@ import ( "context" "net" "time" + + "gopkg.in/natefinch/npipe.v2" ) // This is used if the dialing context has no deadline. It is much smaller than the diff --git a/rpc/server.go b/rpc/server.go index 34b12f581ab3..11373b504cc4 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -26,6 +26,7 @@ import ( "sync/atomic" "github.com/ethereum/go-ethereum/log" + "gopkg.in/fatih/set.v0" ) const MetadataApi = "rpc" diff --git a/rpc/types.go b/rpc/types.go index 227568de01a9..f2375604ed95 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -24,6 +24,7 @@ import ( "sync" "github.com/ethereum/go-ethereum/common/hexutil" + "gopkg.in/fatih/set.v0" ) // API describes the set of methods offered over the RPC interface diff --git a/rpc/websocket.go b/rpc/websocket.go index 0354af32a241..59a0420c0382 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -32,6 +32,7 @@ import ( "golang.org/x/net/websocket" "github.com/ethereum/go-ethereum/log" + "gopkg.in/fatih/set.v0" ) // websocketJSONCodec is a custom JSON codec with payload size enforcement and diff --git a/swarm/metrics/flags.go b/swarm/metrics/flags.go index 00edaebf4262..48b231b219be 100644 --- a/swarm/metrics/flags.go +++ b/swarm/metrics/flags.go @@ -23,6 +23,7 @@ import ( "github.com/ethereum/go-ethereum/log" gethmetrics "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics/influxdb" + "gopkg.in/urfave/cli.v1" ) var ( diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/token.go b/vendor/github.com/Azure/go-autorest/autorest/azure/token.go index b4c03459217f..cfcd030114c6 100644 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/token.go +++ b/vendor/github.com/Azure/go-autorest/autorest/azure/token.go @@ -13,6 +13,7 @@ import ( "time" "github.com/Azure/go-autorest/autorest" + "github.com/dgrijalva/jwt-go" ) const ( diff --git a/vendor/github.com/StackExchange/wmi/swbemservices.go b/vendor/github.com/StackExchange/wmi/swbemservices.go index 18fcca61b3a1..9765a53f74db 100644 --- a/vendor/github.com/StackExchange/wmi/swbemservices.go +++ b/vendor/github.com/StackExchange/wmi/swbemservices.go @@ -8,6 +8,7 @@ import ( "runtime" "sync" + "github.com/go-ole/go-ole" "github.com/go-ole/go-ole/oleutil" ) diff --git a/vendor/github.com/StackExchange/wmi/wmi.go b/vendor/github.com/StackExchange/wmi/wmi.go index 33d0e8b47291..a951b1258b04 100644 --- a/vendor/github.com/StackExchange/wmi/wmi.go +++ b/vendor/github.com/StackExchange/wmi/wmi.go @@ -37,6 +37,7 @@ import ( "sync" "time" + "github.com/go-ole/go-ole" "github.com/go-ole/go-ole/oleutil" ) diff --git a/vendor/github.com/fatih/color/color.go b/vendor/github.com/fatih/color/color.go index f30e5f50b87b..34cd8e4c8ac1 100644 --- a/vendor/github.com/fatih/color/color.go +++ b/vendor/github.com/fatih/color/color.go @@ -7,6 +7,9 @@ import ( "strconv" "strings" "sync" + + "github.com/mattn/go-colorable" + "github.com/mattn/go-isatty" ) var ( diff --git a/vendor/github.com/gizak/termui/events.go b/vendor/github.com/gizak/termui/events.go index f8cda39d7413..16d9bd9cc34a 100644 --- a/vendor/github.com/gizak/termui/events.go +++ b/vendor/github.com/gizak/termui/events.go @@ -9,6 +9,8 @@ import ( "strconv" "sync" "time" + + "github.com/nsf/termbox-go" ) type Event struct { diff --git a/vendor/github.com/gizak/termui/textbuilder.go b/vendor/github.com/gizak/termui/textbuilder.go index 3c1b6817915e..12e2055b5095 100644 --- a/vendor/github.com/gizak/termui/textbuilder.go +++ b/vendor/github.com/gizak/termui/textbuilder.go @@ -7,6 +7,8 @@ package termui import ( "regexp" "strings" + + "github.com/mitchellh/go-wordwrap" ) // TextBuilder is a minimal interface to produce text []Cell using specific syntax (markdown). diff --git a/vendor/github.com/mattn/go-colorable/colorable_windows.go b/vendor/github.com/mattn/go-colorable/colorable_windows.go index 88d5b5611a5d..628ad904e591 100644 --- a/vendor/github.com/mattn/go-colorable/colorable_windows.go +++ b/vendor/github.com/mattn/go-colorable/colorable_windows.go @@ -9,6 +9,8 @@ import ( "strings" "syscall" "unsafe" + + "github.com/mattn/go-isatty" ) const ( diff --git a/vendor/github.com/nsf/termbox-go/api.go b/vendor/github.com/nsf/termbox-go/api.go index 717c4ad76c87..b242ddcf3a23 100644 --- a/vendor/github.com/nsf/termbox-go/api.go +++ b/vendor/github.com/nsf/termbox-go/api.go @@ -2,6 +2,7 @@ package termbox +import "github.com/mattn/go-runewidth" import "fmt" import "os" import "os/signal" diff --git a/vendor/github.com/nsf/termbox-go/termbox_windows.go b/vendor/github.com/nsf/termbox-go/termbox_windows.go index b2c184e69610..f7dad7b8a5fb 100644 --- a/vendor/github.com/nsf/termbox-go/termbox_windows.go +++ b/vendor/github.com/nsf/termbox-go/termbox_windows.go @@ -3,6 +3,7 @@ package termbox import "syscall" import "unsafe" import "unicode/utf16" +import "github.com/mattn/go-runewidth" type ( wchar uint16 diff --git a/vendor/github.com/olekukonko/tablewriter/util.go b/vendor/github.com/olekukonko/tablewriter/util.go index a39721d8d50d..2deefbc52a0a 100644 --- a/vendor/github.com/olekukonko/tablewriter/util.go +++ b/vendor/github.com/olekukonko/tablewriter/util.go @@ -11,6 +11,8 @@ import ( "math" "regexp" "strings" + + "github.com/mattn/go-runewidth" ) var ansi = regexp.MustCompile("\033\\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]") diff --git a/vendor/github.com/robertkrimen/otto/ast/comments.go b/vendor/github.com/robertkrimen/otto/ast/comments.go index 5c9485525e72..ef2cc3d89b92 100644 --- a/vendor/github.com/robertkrimen/otto/ast/comments.go +++ b/vendor/github.com/robertkrimen/otto/ast/comments.go @@ -2,7 +2,6 @@ package ast import ( "fmt" - "github.com/robertkrimen/otto/file" ) diff --git a/vendor/github.com/robertkrimen/otto/file/file.go b/vendor/github.com/robertkrimen/otto/file/file.go index 7f6bd17fd40a..9093206e8e59 100644 --- a/vendor/github.com/robertkrimen/otto/file/file.go +++ b/vendor/github.com/robertkrimen/otto/file/file.go @@ -5,6 +5,8 @@ package file import ( "fmt" "strings" + + "gopkg.in/sourcemap.v1" ) // Idx is a compact encoding of a source position within a file set. diff --git a/vendor/github.com/robertkrimen/otto/parser/parser.go b/vendor/github.com/robertkrimen/otto/parser/parser.go index f7fe0aaee347..75b7c500c439 100644 --- a/vendor/github.com/robertkrimen/otto/parser/parser.go +++ b/vendor/github.com/robertkrimen/otto/parser/parser.go @@ -43,6 +43,7 @@ import ( "github.com/robertkrimen/otto/ast" "github.com/robertkrimen/otto/file" "github.com/robertkrimen/otto/token" + "gopkg.in/sourcemap.v1" ) // A Mode value is a set of flags (or 0). They control optional parser functionality. diff --git a/vendor/github.com/robertkrimen/otto/result.go b/vendor/github.com/robertkrimen/otto/result.go index a8f9b3b185cd..63642e7d039e 100644 --- a/vendor/github.com/robertkrimen/otto/result.go +++ b/vendor/github.com/robertkrimen/otto/result.go @@ -1,5 +1,7 @@ package otto +import () + type _resultKind int const ( diff --git a/vendor/github.com/stretchr/testify/require/require.go b/vendor/github.com/stretchr/testify/require/require.go index 50f8dc5444b9..2fe055784644 100644 --- a/vendor/github.com/stretchr/testify/require/require.go +++ b/vendor/github.com/stretchr/testify/require/require.go @@ -6,11 +6,10 @@ package require import ( + assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" - - assert "github.com/stretchr/testify/assert" ) // Condition uses a Comparison to assert a complex condition. diff --git a/vendor/github.com/stretchr/testify/require/require_forward.go b/vendor/github.com/stretchr/testify/require/require_forward.go index cee247f19bfc..c59c3c7b475e 100644 --- a/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/vendor/github.com/stretchr/testify/require/require_forward.go @@ -6,11 +6,10 @@ package require import ( + assert "github.com/stretchr/testify/assert" http "net/http" url "net/url" time "time" - - assert "github.com/stretchr/testify/assert" ) // Condition uses a Comparison to assert a complex condition. diff --git a/vendor/github.com/syndtr/goleveldb/leveldb/storage.go b/vendor/github.com/syndtr/goleveldb/leveldb/storage.go index 6eebc25446fa..d45fb5dfeb14 100644 --- a/vendor/github.com/syndtr/goleveldb/leveldb/storage.go +++ b/vendor/github.com/syndtr/goleveldb/leveldb/storage.go @@ -1,9 +1,8 @@ package leveldb import ( - "sync/atomic" - "github.com/syndtr/goleveldb/leveldb/storage" + "sync/atomic" ) type iStorage struct { diff --git a/vendor/golang.org/x/crypto/openpgp/armor/armor.go b/vendor/golang.org/x/crypto/openpgp/armor/armor.go index ab86e8c07219..592d18643617 100644 --- a/vendor/golang.org/x/crypto/openpgp/armor/armor.go +++ b/vendor/golang.org/x/crypto/openpgp/armor/armor.go @@ -10,9 +10,8 @@ import ( "bufio" "bytes" "encoding/base64" - "io" - "golang.org/x/crypto/openpgp/errors" + "io" ) // A Block represents an OpenPGP armored structure. diff --git a/vendor/golang.org/x/crypto/openpgp/packet/compressed.go b/vendor/golang.org/x/crypto/openpgp/packet/compressed.go index 6a719dfcea82..e8f0b5caa7df 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/compressed.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/compressed.go @@ -8,10 +8,9 @@ import ( "compress/bzip2" "compress/flate" "compress/zlib" + "golang.org/x/crypto/openpgp/errors" "io" "strconv" - - "golang.org/x/crypto/openpgp/errors" ) // Compressed represents a compressed OpenPGP packet. The decompressed contents diff --git a/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go b/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go index eb6a31bc6ab7..1713503395e3 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/one_pass_signature.go @@ -7,11 +7,10 @@ package packet import ( "crypto" "encoding/binary" - "io" - "strconv" - "golang.org/x/crypto/openpgp/errors" "golang.org/x/crypto/openpgp/s2k" + "io" + "strconv" ) // OnePassSignature represents a one-pass signature packet. See RFC 4880, diff --git a/vendor/golang.org/x/crypto/openpgp/packet/packet.go b/vendor/golang.org/x/crypto/openpgp/packet/packet.go index f5183d4e6bc0..3eded93f042d 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/packet.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/packet.go @@ -11,11 +11,10 @@ import ( "crypto/aes" "crypto/cipher" "crypto/des" - "io" - "math/big" - "golang.org/x/crypto/cast5" "golang.org/x/crypto/openpgp/errors" + "io" + "math/big" ) // readFull is the same as io.ReadFull except that reading zero bytes returns diff --git a/vendor/golang.org/x/crypto/openpgp/packet/reader.go b/vendor/golang.org/x/crypto/openpgp/packet/reader.go index 2a4ac8500802..34bc7c613e6e 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/reader.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/reader.go @@ -5,9 +5,8 @@ package packet import ( - "io" - "golang.org/x/crypto/openpgp/errors" + "io" ) // Reader reads packets from an io.Reader and allows packets to be 'unread' so diff --git a/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go b/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go index 789a27dca7b0..6126030eb903 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/symmetrically_encrypted.go @@ -8,11 +8,10 @@ import ( "crypto/cipher" "crypto/sha1" "crypto/subtle" + "golang.org/x/crypto/openpgp/errors" "hash" "io" "strconv" - - "golang.org/x/crypto/openpgp/errors" ) // SymmetricallyEncrypted represents a symmetrically encrypted byte string. The diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go index 5dafc5a8afc0..a2e1b57dc148 100644 --- a/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go +++ b/vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go @@ -7,10 +7,9 @@ package terminal // import "golang.org/x/crypto/ssh/terminal" import ( + "golang.org/x/sys/unix" "io" "syscall" - - "golang.org/x/sys/unix" ) // State contains the state of a terminal. diff --git a/vendor/gopkg.in/check.v1/benchmark.go b/vendor/gopkg.in/check.v1/benchmark.go index b2d351948d22..46ea9dc6dad6 100644 --- a/vendor/gopkg.in/check.v1/benchmark.go +++ b/vendor/gopkg.in/check.v1/benchmark.go @@ -1,9 +1,9 @@ // Copyright (c) 2012 The Go Authors. All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: -// +// // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above @@ -13,7 +13,7 @@ // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR diff --git a/whisper/shhclient/client.go b/whisper/shhclient/client.go index c3ce44f25b54..bbe694baaa1d 100644 --- a/whisper/shhclient/client.go +++ b/whisper/shhclient/client.go @@ -19,6 +19,7 @@ package shhclient import ( "context" + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/rpc" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" From b2e72fccd6ee1b787f33454a8fde4382b833be06 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Thu, 5 Apr 2018 21:24:36 +0200 Subject: [PATCH 07/15] build: increasing deadline as travis build fails with error: (deadline exceeded by linter vet (try increasing --deadline)) --- build/ci.go | 1 + 1 file changed, 1 insertion(+) diff --git a/build/ci.go b/build/ci.go index 9214ebd8c6c4..a2a6c91f2508 100644 --- a/build/ci.go +++ b/build/ci.go @@ -340,6 +340,7 @@ func doLint(cmdline []string) { "--enable=gofmt", "--enable=misspell", "--enable=goconst", + "--deadline=5m", "--min-occurrences=6", // for goconst } build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), append(configs, packages...)...) From f77e0b46e0e3bd192a2d89aa011b59e032c74bc5 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Fri, 6 Apr 2018 16:34:13 +0200 Subject: [PATCH 08/15] build: revert the changes to import lists remove lint from travis go 1.9.x linux builder errors reported by varcheck -> delete the variables instead of commenting them out --- .travis.yml | 1 - Makefile | 3 --- accounts/abi/bind/bind_test.go | 3 +-- accounts/abi/event_test.go | 5 ++--- accounts/abi/type_test.go | 1 - accounts/abi/unpack_test.go | 3 +-- accounts/keystore/account_cache.go | 3 +-- accounts/keystore/account_cache_test.go | 1 - accounts/keystore/key.go | 3 +-- accounts/keystore/keystore_passphrase.go | 7 +++---- accounts/keystore/presale.go | 5 ++--- accounts/keystore/watch.go | 3 +-- accounts/usbwallet/hub.go | 3 +-- accounts/usbwallet/ledger.go | 2 -- accounts/usbwallet/trezor.go | 3 +-- accounts/usbwallet/wallet.go | 3 +-- build/{gofmt.sh => goimports.sh} | 0 cmd/ethkey/generate.go | 5 ++--- cmd/ethkey/main.go | 4 ---- cmd/ethkey/run_test.go | 1 - cmd/evm/disasm.go | 3 +-- cmd/evm/runner.go | 3 +-- cmd/faucet/faucet.go | 3 +-- cmd/geth/bugcmd.go | 3 +-- cmd/geth/config.go | 3 +-- cmd/geth/run_test.go | 1 - cmd/p2psim/main.go | 3 +-- cmd/puppeth/ssh.go | 3 +-- cmd/puppeth/wizard.go | 3 +-- cmd/puppeth/wizard_netstats.go | 3 +-- cmd/swarm/config.go | 3 +-- cmd/swarm/run_test.go | 1 - cmd/wnode/main.go | 3 +-- consensus/clique/clique.go | 3 +-- consensus/clique/snapshot.go | 3 +-- consensus/consensus.go | 3 +-- consensus/ethash/consensus.go | 3 +-- consensus/ethash/ethash.go | 3 +-- console/bridge.go | 3 +-- console/console.go | 7 +++---- core/asm/compiler.go | 4 ---- core/genesis_test.go | 1 - core/headerchain.go | 3 +-- core/state/database.go | 3 +-- core/state/state_test.go | 3 +-- core/tx_pool.go | 4 +--- core/types/log_test.go | 1 - core/types/transaction.go | 1 - core/vm/contracts.go | 3 +-- core/vm/instructions.go | 1 - dashboard/dashboard.go | 3 +-- eth/api_test.go | 1 - eth/downloader/queue.go | 3 +-- eth/fetcher/fetcher.go | 3 +-- eth/tracers/tracer.go | 3 +-- ethdb/database.go | 5 ++--- ethstats/ethstats.go | 3 +-- internal/debug/flags.go | 3 +-- internal/ethapi/api.go | 5 ++--- internal/jsre/jsre.go | 3 +-- les/bloombits.go | 9 --------- les/serverpool.go | 4 ---- les/sync.go | 4 ---- light/trie_test.go | 1 - metrics/influxdb/influxdb.go | 3 +-- node/node.go | 3 +-- p2p/dial_test.go | 1 - p2p/discover/database.go | 7 +++---- p2p/discover/udp.go | 1 - p2p/discover/udp_test.go | 1 - p2p/discv5/database.go | 7 +++---- p2p/discv5/net.go | 3 --- p2p/discv5/table.go | 1 - p2p/discv5/udp.go | 8 -------- p2p/discv5/udp_test.go | 5 ----- p2p/enr/enr.go | 1 - p2p/enr/enr_test.go | 5 ++--- p2p/peer.go | 2 -- p2p/rlpx.go | 3 +-- p2p/rlpx_test.go | 1 - p2p/simulations/adapters/docker.go | 1 - p2p/simulations/adapters/exec.go | 3 +-- p2p/simulations/adapters/types.go | 1 - p2p/simulations/http.go | 5 ++--- rpc/client_test.go | 1 - rpc/websocket.go | 3 +-- swarm/api/http/server.go | 3 +-- swarm/fuse/fuse_dir.go | 7 +++---- swarm/fuse/fuse_file.go | 3 +-- swarm/fuse/swarmfs.go | 3 +-- swarm/fuse/swarmfs_unix.go | 1 - swarm/network/syncdb.go | 5 ++--- swarm/storage/database.go | 3 +-- swarm/storage/dbstore.go | 6 ++---- swarm/storage/netstore.go | 4 ---- trie/sync.go | 3 +-- trie/trie_test.go | 1 - whisper/mailserver/mailserver.go | 5 ++--- whisper/whisperv5/api.go | 3 --- whisper/whisperv5/peer.go | 3 +-- whisper/whisperv5/whisper.go | 9 ++++----- whisper/whisperv6/api.go | 3 --- whisper/whisperv6/api_test.go | 3 +-- whisper/whisperv6/benchmarks_test.go | 3 +-- whisper/whisperv6/peer.go | 3 +-- whisper/whisperv6/whisper.go | 9 ++++----- whisper/whisperv6/whisper_test.go | 3 +-- 107 files changed, 95 insertions(+), 247 deletions(-) rename build/{gofmt.sh => goimports.sh} (100%) diff --git a/.travis.yml b/.travis.yml index a2cec08157da..40d940de0d5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,6 @@ matrix: - sudo chown root:$USER /etc/fuse.conf - go run build/ci.go install - go run build/ci.go test -coverage - - go run build/ci.go lint # These are the latest Go versions. - os: linux diff --git a/Makefile b/Makefile index 744a3511aa6f..2c69839fea8c 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,6 @@ test: all lint: ## Run linters. Use make install-linters first. build/env.sh go run build/ci.go lint -format: # Formats the code. Must have goimports installed - build/gofmt.sh - clean: rm -fr build/_workspace/pkg/ $(GOBIN)/* diff --git a/accounts/abi/bind/bind_test.go b/accounts/abi/bind/bind_test.go index 5abad1c69d03..2a5a88648771 100644 --- a/accounts/abi/bind/bind_test.go +++ b/accounts/abi/bind/bind_test.go @@ -26,9 +26,8 @@ import ( "strings" "testing" - "golang.org/x/tools/imports" - "github.com/ethereum/go-ethereum/common" + "golang.org/x/tools/imports" ) var bindTests = []struct { diff --git a/accounts/abi/event_test.go b/accounts/abi/event_test.go index c4498e915113..cca61e433dd6 100644 --- a/accounts/abi/event_test.go +++ b/accounts/abi/event_test.go @@ -25,11 +25,10 @@ import ( "strings" "testing" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var jsonEventTransfer = []byte(`{ diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index fe7436937463..f6b36f18fd54 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -22,7 +22,6 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" ) diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index 59d394a79f12..bdbab10b4f43 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -26,9 +26,8 @@ import ( "strings" "testing" - "github.com/stretchr/testify/require" - "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/require" ) type unpackTest struct { diff --git a/accounts/keystore/account_cache.go b/accounts/keystore/account_cache.go index 95c4dec26889..71f698ece71a 100644 --- a/accounts/keystore/account_cache.go +++ b/accounts/keystore/account_cache.go @@ -27,11 +27,10 @@ import ( "sync" "time" - "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" + "gopkg.in/fatih/set.v0" ) // Minimum amount of time between cache reloads. This limit applies if the platform does diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go index 884c7489155c..fe9233c046e7 100644 --- a/accounts/keystore/account_cache_test.go +++ b/accounts/keystore/account_cache_test.go @@ -29,7 +29,6 @@ import ( "github.com/cespare/cp" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" ) diff --git a/accounts/keystore/key.go b/accounts/keystore/key.go index 65e956f3ea66..211fa863d7bd 100644 --- a/accounts/keystore/key.go +++ b/accounts/keystore/key.go @@ -29,11 +29,10 @@ import ( "strings" "time" - "github.com/pborman/uuid" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" + "github.com/pborman/uuid" ) const ( diff --git a/accounts/keystore/keystore_passphrase.go b/accounts/keystore/keystore_passphrase.go index 76b77423a8c5..eaec39f7df28 100644 --- a/accounts/keystore/keystore_passphrase.go +++ b/accounts/keystore/keystore_passphrase.go @@ -36,14 +36,13 @@ import ( "io/ioutil" "path/filepath" - "github.com/pborman/uuid" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/crypto/scrypt" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/randentropy" + "github.com/pborman/uuid" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/crypto/scrypt" ) const ( diff --git a/accounts/keystore/presale.go b/accounts/keystore/presale.go index 3c7550f38639..1554294e14e1 100644 --- a/accounts/keystore/presale.go +++ b/accounts/keystore/presale.go @@ -25,11 +25,10 @@ import ( "errors" "fmt" - "github.com/pborman/uuid" - "golang.org/x/crypto/pbkdf2" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/crypto" + "github.com/pborman/uuid" + "golang.org/x/crypto/pbkdf2" ) // creates a Key and stores that in the given KeyStore by decrypting a presale key JSON diff --git a/accounts/keystore/watch.go b/accounts/keystore/watch.go index 82c9b10e4a2a..bbcfb99257ad 100644 --- a/accounts/keystore/watch.go +++ b/accounts/keystore/watch.go @@ -21,9 +21,8 @@ package keystore import ( "time" - "github.com/rjeczalik/notify" - "github.com/ethereum/go-ethereum/log" + "github.com/rjeczalik/notify" ) type watcher struct { diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index 1989a9e366f3..61fc98ccc80e 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -22,11 +22,10 @@ import ( "sync" "time" - "github.com/karalabe/hid" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" + "github.com/karalabe/hid" ) // LedgerScheme is the protocol scheme prefixing account and wallet URLs. diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index 9da72462a956..57f4a7ffc5bc 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -53,11 +53,9 @@ const ( ledgerOpGetConfiguration ledgerOpcode = 0x06 // Returns specific wallet application configuration ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet - //ledgerP1ConfirmFetchAddress ledgerParam1 = 0x01 // Require a user confirmation before returning the address ledgerP1InitTransactionData ledgerParam1 = 0x00 // First transaction data block for signing ledgerP1ContTransactionData ledgerParam1 = 0x80 // Subsequent transaction data block for signing ledgerP2DiscardAddressChainCode ledgerParam2 = 0x00 // Do not return the chain code along with the address - //ledgerP2ReturnAddressChainCode ledgerParam2 = 0x01 // Require a user confirmation before returning the address ) // errLedgerReplyInvalidHeader is the error message returned by a Ledger data exchange diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index 35f7e6aa889c..b84a955992ff 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,14 +27,13 @@ import ( "io" "math/big" - "github.com/golang/protobuf/proto" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/usbwallet/internal/trezor" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" + "github.com/golang/protobuf/proto" ) // ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index 30712dc5d2c3..8b3b5a522402 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,13 +25,12 @@ import ( "sync" "time" - "github.com/karalabe/hid" - ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" + "github.com/karalabe/hid" ) // Maximum time between wallet health checks to detect USB unplugs. diff --git a/build/gofmt.sh b/build/goimports.sh similarity index 100% rename from build/gofmt.sh rename to build/goimports.sh diff --git a/cmd/ethkey/generate.go b/cmd/ethkey/generate.go index b4d22613bd5b..6d57d17fb4e8 100644 --- a/cmd/ethkey/generate.go +++ b/cmd/ethkey/generate.go @@ -23,12 +23,11 @@ import ( "os" "path/filepath" - "github.com/pborman/uuid" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/crypto" + "github.com/pborman/uuid" + "gopkg.in/urfave/cli.v1" ) type outputGenerate struct { diff --git a/cmd/ethkey/main.go b/cmd/ethkey/main.go index 7543c1efdb30..4127f5566f0f 100644 --- a/cmd/ethkey/main.go +++ b/cmd/ethkey/main.go @@ -53,10 +53,6 @@ var ( Name: "json", Usage: "output JSON instead of human-readable format", } - //messageFlag = cli.StringFlag{ - // Name: "message", - // Usage: "the file that contains the message to sign/verify", - //} ) func main() { diff --git a/cmd/ethkey/run_test.go b/cmd/ethkey/run_test.go index 857d3045abb8..6006f6b5bb70 100644 --- a/cmd/ethkey/run_test.go +++ b/cmd/ethkey/run_test.go @@ -22,7 +22,6 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/internal/cmdtest" ) diff --git a/cmd/evm/disasm.go b/cmd/evm/disasm.go index 19bc28e15a7d..4a442cf78445 100644 --- a/cmd/evm/disasm.go +++ b/cmd/evm/disasm.go @@ -22,9 +22,8 @@ import ( "io/ioutil" "strings" - cli "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/core/asm" + cli "gopkg.in/urfave/cli.v1" ) var disasmCommand = cli.Command{ diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 0e44e84aa5a5..8a7399840cf7 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -27,8 +27,6 @@ import ( goruntime "runtime" - cli "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/evm/internal/compiler" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" @@ -39,6 +37,7 @@ import ( "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" + cli "gopkg.in/urfave/cli.v1" ) var runCommand = cli.Command{ diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 9668813c034a..5bad09bbd576 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -41,8 +41,6 @@ import ( "sync" "time" - "golang.org/x/net/websocket" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -60,6 +58,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/discv5" "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/params" + "golang.org/x/net/websocket" ) var ( diff --git a/cmd/geth/bugcmd.go b/cmd/geth/bugcmd.go index ecfb7ffa2234..ce9dbe6c0a75 100644 --- a/cmd/geth/bugcmd.go +++ b/cmd/geth/bugcmd.go @@ -29,9 +29,8 @@ import ( "github.com/ethereum/go-ethereum/cmd/internal/browser" "github.com/ethereum/go-ethereum/params" - cli "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/cmd/utils" + cli "gopkg.in/urfave/cli.v1" ) var bugCommand = cli.Command{ diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 1cd9c6be986b..e6bd4d5bef41 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -27,14 +27,13 @@ import ( cli "gopkg.in/urfave/cli.v1" - "github.com/naoina/toml" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/dashboard" "github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/params" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/naoina/toml" ) var ( diff --git a/cmd/geth/run_test.go b/cmd/geth/run_test.go index f94050124a27..da82facac36e 100644 --- a/cmd/geth/run_test.go +++ b/cmd/geth/run_test.go @@ -23,7 +23,6 @@ import ( "testing" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/internal/cmdtest" ) diff --git a/cmd/p2psim/main.go b/cmd/p2psim/main.go index 38a54add4e2d..0c8ed038d5b6 100644 --- a/cmd/p2psim/main.go +++ b/cmd/p2psim/main.go @@ -45,14 +45,13 @@ import ( "strings" "text/tabwriter" - "gopkg.in/urfave/cli.v1" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/simulations" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" + "gopkg.in/urfave/cli.v1" ) var client *simulations.Client diff --git a/cmd/puppeth/ssh.go b/cmd/puppeth/ssh.go index ffc1488336e4..158261ce0516 100644 --- a/cmd/puppeth/ssh.go +++ b/cmd/puppeth/ssh.go @@ -28,10 +28,9 @@ import ( "path/filepath" "strings" + "github.com/ethereum/go-ethereum/log" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/terminal" - - "github.com/ethereum/go-ethereum/log" ) // sshClient is a small wrapper around Go's SSH client with a few utility methods diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go index 09f67809fe32..b88a61de7ded 100644 --- a/cmd/puppeth/wizard.go +++ b/cmd/puppeth/wizard.go @@ -30,11 +30,10 @@ import ( "strings" "sync" - "golang.org/x/crypto/ssh/terminal" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/log" + "golang.org/x/crypto/ssh/terminal" ) // config contains all the configurations needed by puppeth that should be saved diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index 3c0292505492..90bf7ae3c8dc 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,10 +23,9 @@ import ( "strings" "sync" - "github.com/olekukonko/tablewriter" - "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/log" + "github.com/olekukonko/tablewriter" ) // networkStats verifies the status of network components and generates a protip diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index bfd1a3d96184..adac772babce 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -28,12 +28,11 @@ import ( cli "gopkg.in/urfave/cli.v1" - "github.com/naoina/toml" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" + "github.com/naoina/toml" bzzapi "github.com/ethereum/go-ethereum/swarm/api" ) diff --git a/cmd/swarm/run_test.go b/cmd/swarm/run_test.go index 76310e2fa070..594cfa55cb48 100644 --- a/cmd/swarm/run_test.go +++ b/cmd/swarm/run_test.go @@ -27,7 +27,6 @@ import ( "time" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/internal/cmdtest" diff --git a/cmd/wnode/main.go b/cmd/wnode/main.go index 6aeeb1bbe352..988c50ce3d67 100644 --- a/cmd/wnode/main.go +++ b/cmd/wnode/main.go @@ -35,8 +35,6 @@ import ( "strings" "time" - "golang.org/x/crypto/pbkdf2" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/console" @@ -47,6 +45,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/nat" "github.com/ethereum/go-ethereum/whisper/mailserver" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "golang.org/x/crypto/pbkdf2" ) const quitCommand = "~Q" diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index 22476d94fbd9..2bdad9092aa4 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -25,8 +25,6 @@ import ( "sync" "time" - lru "github.com/hashicorp/golang-lru" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" @@ -41,6 +39,7 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" + lru "github.com/hashicorp/golang-lru" ) const ( diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index d71ced007f0f..9ebdb8df1580 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -20,12 +20,11 @@ import ( "bytes" "encoding/json" - lru "github.com/hashicorp/golang-lru" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/params" + lru "github.com/hashicorp/golang-lru" ) // Vote represents a single vote that an authorized signer made to modify the diff --git a/consensus/consensus.go b/consensus/consensus.go index 5774af1a78eb..be5e661c12bc 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -18,13 +18,12 @@ package consensus import ( - "math/big" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" + "math/big" ) // ChainReader defines a small collection of methods needed to access the local diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index 477019c51d76..99eec82211e2 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -24,8 +24,6 @@ import ( "runtime" "time" - set "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/consensus" @@ -33,6 +31,7 @@ import ( "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" + set "gopkg.in/fatih/set.v0" ) // Ethash proof-of-work protocol constants. diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index ba56fb92ea50..1b3dcee30288 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -33,12 +33,11 @@ import ( "unsafe" mmap "github.com/edsrzf/mmap-go" - "github.com/hashicorp/golang-lru/simplelru" - "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/rpc" + "github.com/hashicorp/golang-lru/simplelru" ) var ErrInvalidDumpMagic = errors.New("invalid dump magic") diff --git a/console/bridge.go b/console/bridge.go index dd12f797e055..b28cc438e210 100644 --- a/console/bridge.go +++ b/console/bridge.go @@ -23,11 +23,10 @@ import ( "strings" "time" - "github.com/robertkrimen/otto" - "github.com/ethereum/go-ethereum/accounts/usbwallet" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rpc" + "github.com/robertkrimen/otto" ) // bridge is a collection of JavaScript utility methods to bride the .js runtime diff --git a/console/console.go b/console/console.go index cef5d3c7be09..b280d4e65d4c 100644 --- a/console/console.go +++ b/console/console.go @@ -28,13 +28,12 @@ import ( "strings" "syscall" - "github.com/mattn/go-colorable" - "github.com/peterh/liner" - "github.com/robertkrimen/otto" - "github.com/ethereum/go-ethereum/internal/jsre" "github.com/ethereum/go-ethereum/internal/web3ext" "github.com/ethereum/go-ethereum/rpc" + "github.com/mattn/go-colorable" + "github.com/peterh/liner" + "github.com/robertkrimen/otto" ) var ( diff --git a/core/asm/compiler.go b/core/asm/compiler.go index abe2992a9292..b430b6495c51 100644 --- a/core/asm/compiler.go +++ b/core/asm/compiler.go @@ -263,10 +263,6 @@ func (err compileError) Error() string { return fmt.Sprintf("%d syntax error: unexpected %v, expected %v", err.lineno, err.got, err.want) } -//var ( -// errExpBol = errors.New("expected beginning of line") -// errExpElementOrLabel = errors.New("expected beginning of line") -//) func compileErr(c token, got, want string) error { return compileError{ diff --git a/core/genesis_test.go b/core/genesis_test.go index 48845c12864c..052ded6991f9 100644 --- a/core/genesis_test.go +++ b/core/genesis_test.go @@ -22,7 +22,6 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core/vm" diff --git a/core/headerchain.go b/core/headerchain.go index 70dfe6dd20a6..2d1b0a2a185f 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,14 +26,13 @@ import ( "sync/atomic" "time" - "github.com/hashicorp/golang-lru" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" + "github.com/hashicorp/golang-lru" ) const ( diff --git a/core/state/database.go b/core/state/database.go index 8bf8b9b411e3..c1b630991ce0 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -20,11 +20,10 @@ import ( "fmt" "sync" - lru "github.com/hashicorp/golang-lru" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/trie" + lru "github.com/hashicorp/golang-lru" ) // Trie cache generation limit after which to evict trie nodes from memory. diff --git a/core/state/state_test.go b/core/state/state_test.go index 5e527fc11536..6d42d63d8290 100644 --- a/core/state/state_test.go +++ b/core/state/state_test.go @@ -21,11 +21,10 @@ import ( "math/big" "testing" - checker "gopkg.in/check.v1" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" + checker "gopkg.in/check.v1" ) type StateSuite struct { diff --git a/core/tx_pool.go b/core/tx_pool.go index 8db43e811cf2..6886326cc049 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -25,8 +25,6 @@ import ( "sync" "time" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" @@ -34,13 +32,13 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/params" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) const ( // chainHeadChanSize is the size of channel listening to ChainHeadEvent. chainHeadChanSize = 10 // rmTxChanSize is the size of channel listening to RemovedTransactionEvent. - //rmTxChanSize = 10 ) var ( diff --git a/core/types/log_test.go b/core/types/log_test.go index bbe872b6647a..0e56acfe4aa3 100644 --- a/core/types/log_test.go +++ b/core/types/log_test.go @@ -23,7 +23,6 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" ) diff --git a/core/types/transaction.go b/core/types/transaction.go index adf08c40c4ed..92fd8f898e8b 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -33,7 +33,6 @@ import ( var ( ErrInvalidSig = errors.New("invalid transaction v, r, s values") - //errNoSigner = errors.New("missing signing methods") ) // deriveSigner makes a *best* guess about which signer to use. diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 237ac18d7d3c..237450ea96b0 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -21,13 +21,12 @@ import ( "errors" "math/big" - "golang.org/x/crypto/ripemd160" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/math" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/bn256" "github.com/ethereum/go-ethereum/params" + "golang.org/x/crypto/ripemd160" ) // PrecompiledContract is the basic interface for native Go contracts. The implementation diff --git a/core/vm/instructions.go b/core/vm/instructions.go index bcb8c40bfa1b..bb313f2a3569 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -31,7 +31,6 @@ import ( var ( bigZero = new(big.Int) tt255 = math.BigPow(2, 255) - //tt256 = math.BigPow(2, 256) errWriteProtection = errors.New("evm: write protection") errReturnDataOutOfBounds = errors.New("evm: return data out of bounds") errExecutionReverted = errors.New("evm: execution reverted") diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index bc222123a85c..399fa34c08e6 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -33,13 +33,12 @@ import ( "time" "github.com/elastic/gosigar" - "golang.org/x/net/websocket" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" + "golang.org/x/net/websocket" ) const ( diff --git a/eth/api_test.go b/eth/api_test.go index 99d8e3bbffa3..900a82bb6a14 100644 --- a/eth/api_test.go +++ b/eth/api_test.go @@ -21,7 +21,6 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/ethdb" diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index cd065caf1e62..bbe0aed5dca6 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -25,12 +25,11 @@ import ( "sync" "time" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) var ( diff --git a/eth/fetcher/fetcher.go b/eth/fetcher/fetcher.go index 7e2077b46238..0c679cec3a78 100644 --- a/eth/fetcher/fetcher.go +++ b/eth/fetcher/fetcher.go @@ -22,12 +22,11 @@ import ( "math/rand" "time" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) const ( diff --git a/eth/tracers/tracer.go b/eth/tracers/tracer.go index 430514883797..4cec9e633c37 100644 --- a/eth/tracers/tracer.go +++ b/eth/tracers/tracer.go @@ -25,13 +25,12 @@ import ( "time" "unsafe" - duktape "gopkg.in/olebedev/go-duktape.v3" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" + duktape "gopkg.in/olebedev/go-duktape.v3" ) // bigIntegerJS is the minified version of https://github.com/peterolson/BigInteger.js. diff --git a/ethdb/database.go b/ethdb/database.go index f4ac51622a96..30ed37dc7b64 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -22,15 +22,14 @@ import ( "sync" "time" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/filter" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/util" - - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/metrics" ) var OpenFileLimit = 64 diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index d290fd615d96..ae7e25265460 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -30,8 +30,6 @@ import ( "strings" "time" - "golang.org/x/net/websocket" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/mclock" "github.com/ethereum/go-ethereum/consensus" @@ -43,6 +41,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" + "golang.org/x/net/websocket" ) const ( diff --git a/internal/debug/flags.go b/internal/debug/flags.go index d928ea71b84b..1f181bf8b0f0 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,12 +24,11 @@ import ( "os" "runtime" - colorable "github.com/mattn/go-colorable" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log/term" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics/exp" + colorable "github.com/mattn/go-colorable" "gopkg.in/urfave/cli.v1" ) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 876b2c5697b6..e2bfbaf307bb 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -26,9 +26,6 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/util" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/common" @@ -44,6 +41,8 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/util" ) const ( diff --git a/internal/jsre/jsre.go b/internal/jsre/jsre.go index b8079b21373d..f05865eca60d 100644 --- a/internal/jsre/jsre.go +++ b/internal/jsre/jsre.go @@ -26,10 +26,9 @@ import ( "math/rand" "time" - "github.com/robertkrimen/otto" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/internal/jsre/deps" + "github.com/robertkrimen/otto" ) var ( diff --git a/les/bloombits.go b/les/bloombits.go index 900b7a7af0e4..1b16f6de4320 100644 --- a/les/bloombits.go +++ b/les/bloombits.go @@ -73,12 +73,3 @@ func (eth *LightEthereum) startBloomHandlers() { } } -const ( -// bloomConfirms is the number of confirmation blocks before a bloom section is -// considered probably final and its rotated bits are calculated. -//bloomConfirms = 256 - -// bloomThrottling is the time to wait between processing two consecutive index -// sections. It's useful during chain upgrades to prevent disk overload. -//bloomThrottling = 100 * time.Millisecond -) diff --git a/les/serverpool.go b/les/serverpool.go index a87d8d18af6e..da73b4b3c5b2 100644 --- a/les/serverpool.go +++ b/les/serverpool.go @@ -73,7 +73,6 @@ const ( // and a short term value which is adjusted exponentially with a factor of // pstatRecentAdjust with each dial/connection and also returned exponentially // to the average with the time constant pstatReturnToMeanTC - //pstatRecentAdjust = 0.1 pstatReturnToMeanTC = time.Hour // node address selection weight is dropped by a factor of exp(-addrFailDropLn) after // each unsuccessful connection (restored after a successful one) @@ -83,9 +82,6 @@ const ( responseScoreTC = time.Millisecond * 100 delayScoreTC = time.Second * 5 timeoutPow = 10 - // peerSelectMinWeight is added to calculated weights at request peer selection - // to give poorly performing peers a little chance of coming back - //peerSelectMinWeight = 0.005 // initStatsWeight is used to initialize previously unknown peers with good // statistics to give a chance to prove themselves initStatsWeight = 1 diff --git a/les/sync.go b/les/sync.go index 22825b1e052c..d32a3efb9cf0 100644 --- a/les/sync.go +++ b/les/sync.go @@ -25,10 +25,6 @@ import ( "github.com/ethereum/go-ethereum/light" ) -const ( -//forceSyncCycle = 10 * time.Second // Time interval to force syncs, even if few peers are available -//minDesiredPeerCount = 5 // Amount of peers desired to start syncing -) // syncer is responsible for periodically synchronising with the network, both // downloading hashes and blocks as well as handling the announcement handler. diff --git a/light/trie_test.go b/light/trie_test.go index 876caa9ed7d6..0d6b2cc1d8dd 100644 --- a/light/trie_test.go +++ b/light/trie_test.go @@ -23,7 +23,6 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/state" diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index 94f5ec4e4f12..d5cb4da66fad 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -6,9 +6,8 @@ import ( uurl "net/url" "time" - "github.com/influxdata/influxdb/client" - "github.com/ethereum/go-ethereum/metrics" + "github.com/influxdata/influxdb/client" ) type reporter struct { diff --git a/node/node.go b/node/node.go index eebbd9240125..b02aecfad15f 100644 --- a/node/node.go +++ b/node/node.go @@ -26,8 +26,6 @@ import ( "strings" "sync" - "github.com/prometheus/prometheus/util/flock" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/event" @@ -35,6 +33,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" + "github.com/prometheus/prometheus/util/flock" ) // Node is a container on which services can be registered. diff --git a/p2p/dial_test.go b/p2p/dial_test.go index 603021e823a5..2a7941fc6574 100644 --- a/p2p/dial_test.go +++ b/p2p/dial_test.go @@ -24,7 +24,6 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/netutil" ) diff --git a/p2p/discover/database.go b/p2p/discover/database.go index 0b856d68c65a..6f98de9b4246 100644 --- a/p2p/discover/database.go +++ b/p2p/discover/database.go @@ -27,16 +27,15 @@ import ( "sync" "time" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/storage" "github.com/syndtr/goleveldb/leveldb/util" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/discover/udp.go b/p2p/discover/udp.go index f585452f4712..025f81282e44 100644 --- a/p2p/discover/udp.go +++ b/p2p/discover/udp.go @@ -49,7 +49,6 @@ var ( // Timeouts const ( respTimeout = 500 * time.Millisecond - //sendTimeout = 500 * time.Millisecond expiration = 20 * time.Second ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go index 817b6e26f4e8..db9804f7bc6c 100644 --- a/p2p/discover/udp_test.go +++ b/p2p/discover/udp_test.go @@ -34,7 +34,6 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" diff --git a/p2p/discv5/database.go b/p2p/discv5/database.go index 514ae49ef063..3c2d5744c383 100644 --- a/p2p/discv5/database.go +++ b/p2p/discv5/database.go @@ -28,16 +28,15 @@ import ( "sync" "time" + "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/rlp" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/errors" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/storage" "github.com/syndtr/goleveldb/leveldb/util" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/rlp" ) var ( diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go index 618340b291c2..f56e0d320112 100644 --- a/p2p/discv5/net.go +++ b/p2p/discv5/net.go @@ -36,7 +36,6 @@ import ( var ( errInvalidEvent = errors.New("invalid in current state") errNoQuery = errors.New("no pending query") - //errWrongAddress = errors.New("unknown sender address") ) const ( @@ -828,8 +827,6 @@ type nodeEvent uint //go:generate stringer -type=nodeEvent const ( - //invalidEvent - //nodeEvent = iota // zero is reserved // Packet type events. // These correspond to packet types in the UDP protocol. diff --git a/p2p/discv5/table.go b/p2p/discv5/table.go index 2c7116610ad2..c8d234b936d4 100644 --- a/p2p/discv5/table.go +++ b/p2p/discv5/table.go @@ -38,7 +38,6 @@ const ( hashBits = len(common.Hash{}) * 8 nBuckets = hashBits + 1 // Number of buckets - //maxBondingPingPongs = 16 maxFindnodeFailures = 5 ) diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go index 0a5b91bb84ad..5b86698f2965 100644 --- a/p2p/discv5/udp.go +++ b/p2p/discv5/udp.go @@ -38,22 +38,14 @@ const Version = 4 var ( errPacketTooSmall = errors.New("too small") errBadPrefix = errors.New("bad prefix") - //errExpired = errors.New("expired") - //errUnsolicitedReply = errors.New("unsolicited reply") - //errUnknownNode = errors.New("unknown node") errTimeout = errors.New("RPC timeout") - //errClockWarp = errors.New("reply deadline too far in the future") - //errClosed = errors.New("socket closed") ) // Timeouts const ( respTimeout = 500 * time.Millisecond - //queryDelay = 1000 * time.Millisecond expiration = 20 * time.Second - //ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP - //ntpWarningCooldown = 10 * time.Minute // Minimum amount of time to pass before repeating NTP warning driftThreshold = 10 * time.Second // Allowed clock drift before warning user ) diff --git a/p2p/discv5/udp_test.go b/p2p/discv5/udp_test.go index 4a529cd8362c..62184aa9d3bf 100644 --- a/p2p/discv5/udp_test.go +++ b/p2p/discv5/udp_test.go @@ -26,7 +26,6 @@ import ( "testing" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" @@ -38,10 +37,6 @@ func init() { // shared test variables var ( - //futureExp = uint64(time.Now().Add(10 * time.Hour).Unix()) - //testTarget = NodeID{0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1} - //testRemote = rpcEndpoint{IP: net.ParseIP("1.1.1.1").To4(), UDP: 1, TCP: 2} - //testLocalAnnounced = rpcEndpoint{IP: net.ParseIP("2.2.2.2").To4(), UDP: 3, TCP: 4} testLocal = rpcEndpoint{IP: net.ParseIP("3.3.3.3").To4(), UDP: 5, TCP: 6} ) diff --git a/p2p/enr/enr.go b/p2p/enr/enr.go index 15aae6c81904..9244076c9695 100644 --- a/p2p/enr/enr.go +++ b/p2p/enr/enr.go @@ -46,7 +46,6 @@ const ID_SECP256k1_KECCAK = ID("secp256k1-keccak") // the default identity schem var ( errNoID = errors.New("unknown or unspecified identity scheme") - //errInvalidSigsize = errors.New("invalid signature size") errInvalidSig = errors.New("invalid signature") errNotSorted = errors.New("record key/value pairs are not sorted by key") errDuplicateKey = errors.New("record contains duplicate key") diff --git a/p2p/enr/enr_test.go b/p2p/enr/enr_test.go index f4c048a5e073..ce7767d105af 100644 --- a/p2p/enr/enr_test.go +++ b/p2p/enr/enr_test.go @@ -24,11 +24,10 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/rlp" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var ( diff --git a/p2p/peer.go b/p2p/peer.go index cab631d7c6cf..73e33418ed0a 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -47,8 +47,6 @@ const ( discMsg = 0x01 pingMsg = 0x02 pongMsg = 0x03 - //getPeersMsg = 0x04 - //peersMsg = 0x05 ) // protoHandshake is the RLP structure of the protocol handshake. diff --git a/p2p/rlpx.go b/p2p/rlpx.go index 6870a532c55a..a320e81e7c02 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -35,14 +35,13 @@ import ( "sync" "time" - "github.com/golang/snappy" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/crypto/sha3" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/rlp" + "github.com/golang/snappy" ) const ( diff --git a/p2p/rlpx_test.go b/p2p/rlpx_test.go index b6b91d093715..bca460402164 100644 --- a/p2p/rlpx_test.go +++ b/p2p/rlpx_test.go @@ -31,7 +31,6 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/crypto/sha3" diff --git a/p2p/simulations/adapters/docker.go b/p2p/simulations/adapters/docker.go index c92d5a5431c5..8ef5629fb5fb 100644 --- a/p2p/simulations/adapters/docker.go +++ b/p2p/simulations/adapters/docker.go @@ -28,7 +28,6 @@ import ( "strings" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p/discover" diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index 9642c1628f40..a566fb27d8f1 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -36,13 +36,12 @@ import ( "time" "github.com/docker/docker/pkg/reexec" - "golang.org/x/net/websocket" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/rpc" + "golang.org/x/net/websocket" ) // ExecAdapter is a NodeAdapter which runs simulation nodes by executing the diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index e5216f2e7420..5b4b47fe2f80 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -25,7 +25,6 @@ import ( "os" "github.com/docker/docker/pkg/reexec" - "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/p2p" diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index a28b6e70c822..97dd742e8893 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,14 +29,13 @@ import ( "strings" "sync" - "github.com/julienschmidt/httprouter" - "golang.org/x/net/websocket" - "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/rpc" + "github.com/julienschmidt/httprouter" + "golang.org/x/net/websocket" ) // DefaultClient is the default simulation API client which expects the API diff --git a/rpc/client_test.go b/rpc/client_test.go index 8125ba8596ad..4f354d389e74 100644 --- a/rpc/client_test.go +++ b/rpc/client_test.go @@ -31,7 +31,6 @@ import ( "time" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/log" ) diff --git a/rpc/websocket.go b/rpc/websocket.go index 59a0420c0382..a6e1cec28a50 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -29,9 +29,8 @@ import ( "strings" "time" - "golang.org/x/net/websocket" - "github.com/ethereum/go-ethereum/log" + "golang.org/x/net/websocket" "gopkg.in/fatih/set.v0" ) diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go index 1c8f05bdd18c..b8e7436cf066 100644 --- a/swarm/api/http/server.go +++ b/swarm/api/http/server.go @@ -35,13 +35,12 @@ import ( "strings" "time" - "github.com/rs/cors" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/swarm/api" "github.com/ethereum/go-ethereum/swarm/storage" + "github.com/rs/cors" ) //setup metrics diff --git a/swarm/fuse/fuse_dir.go b/swarm/fuse/fuse_dir.go index a7701985ebb6..91b236ae8af0 100644 --- a/swarm/fuse/fuse_dir.go +++ b/swarm/fuse/fuse_dir.go @@ -19,13 +19,12 @@ package fuse import ( - "os" - "path/filepath" - "sync" - "bazil.org/fuse" "bazil.org/fuse/fs" "golang.org/x/net/context" + "os" + "path/filepath" + "sync" ) var ( diff --git a/swarm/fuse/fuse_file.go b/swarm/fuse/fuse_file.go index f45bf0b377dc..c94a0773f525 100644 --- a/swarm/fuse/fuse_file.go +++ b/swarm/fuse/fuse_file.go @@ -26,10 +26,9 @@ import ( "bazil.org/fuse" "bazil.org/fuse/fs" - "golang.org/x/net/context" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" + "golang.org/x/net/context" ) const ( diff --git a/swarm/fuse/swarmfs.go b/swarm/fuse/swarmfs.go index e56d0ad4e39e..2493bdab19ba 100644 --- a/swarm/fuse/swarmfs.go +++ b/swarm/fuse/swarmfs.go @@ -17,10 +17,9 @@ package fuse import ( + "github.com/ethereum/go-ethereum/swarm/api" "sync" "time" - - "github.com/ethereum/go-ethereum/swarm/api" ) const ( diff --git a/swarm/fuse/swarmfs_unix.go b/swarm/fuse/swarmfs_unix.go index 62a15e780bb7..75742845a24f 100644 --- a/swarm/fuse/swarmfs_unix.go +++ b/swarm/fuse/swarmfs_unix.go @@ -29,7 +29,6 @@ import ( "bazil.org/fuse" "bazil.org/fuse/fs" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/api" diff --git a/swarm/network/syncdb.go b/swarm/network/syncdb.go index 7c7a4bf68647..88b4b68dd0f5 100644 --- a/swarm/network/syncdb.go +++ b/swarm/network/syncdb.go @@ -20,11 +20,10 @@ import ( "encoding/binary" "fmt" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/iterator" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/swarm/storage" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/iterator" ) const counterKeyPrefix = 0x01 diff --git a/swarm/storage/database.go b/swarm/storage/database.go index 1bf3bb4c5b6a..2532490cc9cb 100644 --- a/swarm/storage/database.go +++ b/swarm/storage/database.go @@ -22,11 +22,10 @@ package storage import ( "fmt" + "github.com/ethereum/go-ethereum/compression/rle" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/iterator" "github.com/syndtr/goleveldb/leveldb/opt" - - "github.com/ethereum/go-ethereum/compression/rle" ) const openFileLimit = 128 diff --git a/swarm/storage/dbstore.go b/swarm/storage/dbstore.go index a1ea023a60ac..1ff42a0c0577 100644 --- a/swarm/storage/dbstore.go +++ b/swarm/storage/dbstore.go @@ -32,12 +32,11 @@ import ( "io/ioutil" "sync" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/iterator" - "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/rlp" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/iterator" ) //metrics variables @@ -55,7 +54,6 @@ const ( // key prefixes for leveldb storage kpIndex = 0 - //kpData = 1 ) var ( diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 186670a76283..2efc02b59688 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -83,10 +83,6 @@ func NewNetStore(hash SwarmHasher, lstore *LocalStore, cloud CloudStore, params } } -const ( -// maximum number of peers that a retrieved message is delivered to -//requesterCount = 3 -) var ( // timeout interval before retrieval is timed out diff --git a/trie/sync.go b/trie/sync.go index 00bc34f40be6..b573a9f73245 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -20,10 +20,9 @@ import ( "errors" "fmt" - "gopkg.in/karalabe/cookiejar.v2/collections/prque" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethdb" + "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) // ErrNotRequested is returned by the trie sync when it's requested to process a diff --git a/trie/trie_test.go b/trie/trie_test.go index b6a79c2d255f..997222628898 100644 --- a/trie/trie_test.go +++ b/trie/trie_test.go @@ -30,7 +30,6 @@ import ( "testing/quick" "github.com/davecgh/go-spew/spew" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" diff --git a/whisper/mailserver/mailserver.go b/whisper/mailserver/mailserver.go index 2866dcf9661b..57e6505ad16c 100644 --- a/whisper/mailserver/mailserver.go +++ b/whisper/mailserver/mailserver.go @@ -20,15 +20,14 @@ import ( "encoding/binary" "fmt" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/util" - "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" + "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/util" ) type WMailServer struct { diff --git a/whisper/whisperv5/api.go b/whisper/whisperv5/api.go index bdc313fb0d4f..48bb817cb909 100644 --- a/whisper/whisperv5/api.go +++ b/whisper/whisperv5/api.go @@ -32,9 +32,6 @@ import ( "github.com/ethereum/go-ethereum/rpc" ) -const ( -//filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds -) var ( ErrSymAsym = errors.New("specify either a symmetric or an asymmetric key") diff --git a/whisper/whisperv5/peer.go b/whisper/whisperv5/peer.go index 1e19cabad2ae..179c93179514 100644 --- a/whisper/whisperv5/peer.go +++ b/whisper/whisperv5/peer.go @@ -20,12 +20,11 @@ import ( "fmt" "time" - set "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" + set "gopkg.in/fatih/set.v0" ) // peer represents a whisper protocol peer connection. diff --git a/whisper/whisperv5/whisper.go b/whisper/whisperv5/whisper.go index 90d56a576130..85849ccce493 100644 --- a/whisper/whisperv5/whisper.go +++ b/whisper/whisperv5/whisper.go @@ -26,16 +26,15 @@ import ( "sync" "time" - "github.com/syndtr/goleveldb/leveldb/errors" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/sync/syncmap" - set "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rpc" + "github.com/syndtr/goleveldb/leveldb/errors" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/sync/syncmap" + set "gopkg.in/fatih/set.v0" ) type Statistics struct { diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index 9eaf98fb8d88..d879b6d6952f 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -32,9 +32,6 @@ import ( "github.com/ethereum/go-ethereum/rpc" ) -const ( -//filterTimeout = 300 // filters are considered timeout out after filterTimeout seconds -) // List of errors var ( diff --git a/whisper/whisperv6/api_test.go b/whisper/whisperv6/api_test.go index 295f8dab0301..004a41c9496a 100644 --- a/whisper/whisperv6/api_test.go +++ b/whisper/whisperv6/api_test.go @@ -22,9 +22,8 @@ import ( "testing" "time" - set "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" + set "gopkg.in/fatih/set.v0" ) func TestMultipleTopicCopyInNewMessageFilter(t *testing.T) { diff --git a/whisper/whisperv6/benchmarks_test.go b/whisper/whisperv6/benchmarks_test.go index d97ee02c1b3e..0473179da5a5 100644 --- a/whisper/whisperv6/benchmarks_test.go +++ b/whisper/whisperv6/benchmarks_test.go @@ -20,9 +20,8 @@ import ( "crypto/sha256" "testing" - "golang.org/x/crypto/pbkdf2" - "github.com/ethereum/go-ethereum/crypto" + "golang.org/x/crypto/pbkdf2" ) func BenchmarkDeriveKeyMaterial(b *testing.B) { diff --git a/whisper/whisperv6/peer.go b/whisper/whisperv6/peer.go index 3b39bae443f1..2bf1c905b232 100644 --- a/whisper/whisperv6/peer.go +++ b/whisper/whisperv6/peer.go @@ -22,12 +22,11 @@ import ( "sync" "time" - set "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" + set "gopkg.in/fatih/set.v0" ) // Peer represents a whisper protocol peer connection. diff --git a/whisper/whisperv6/whisper.go b/whisper/whisperv6/whisper.go index 455d9c9b1001..880cced09897 100644 --- a/whisper/whisperv6/whisper.go +++ b/whisper/whisperv6/whisper.go @@ -26,17 +26,16 @@ import ( "sync" "time" - "github.com/syndtr/goleveldb/leveldb/errors" - "golang.org/x/crypto/pbkdf2" - "golang.org/x/sync/syncmap" - set "gopkg.in/fatih/set.v0" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" + "github.com/syndtr/goleveldb/leveldb/errors" + "golang.org/x/crypto/pbkdf2" + "golang.org/x/sync/syncmap" + set "gopkg.in/fatih/set.v0" ) // Statistics holds several message-related counter for analytics diff --git a/whisper/whisperv6/whisper_test.go b/whisper/whisperv6/whisper_test.go index 86d0592b34ef..7fe256309e61 100644 --- a/whisper/whisperv6/whisper_test.go +++ b/whisper/whisperv6/whisper_test.go @@ -24,9 +24,8 @@ import ( "testing" "time" - "golang.org/x/crypto/pbkdf2" - "github.com/ethereum/go-ethereum/common" + "golang.org/x/crypto/pbkdf2" ) func TestWhisperBasic(t *testing.T) { From 84c3eadfbc38d8ae4013360d5808d3847f3db4fb Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Fri, 6 Apr 2018 16:45:02 +0200 Subject: [PATCH 09/15] build: gofmt all files --- accounts/usbwallet/ledger.go | 2 +- core/asm/compiler.go | 1 - core/vm/instructions.go | 4 ++-- les/bloombits.go | 1 - les/sync.go | 1 - p2p/discover/udp.go | 2 +- p2p/discv5/udp.go | 4 ++-- p2p/enr/enr.go | 2 +- swarm/storage/netstore.go | 1 - whisper/whisperv5/api.go | 1 - whisper/whisperv6/api.go | 1 - 11 files changed, 7 insertions(+), 13 deletions(-) diff --git a/accounts/usbwallet/ledger.go b/accounts/usbwallet/ledger.go index 57f4a7ffc5bc..7ad32dd1e847 100644 --- a/accounts/usbwallet/ledger.go +++ b/accounts/usbwallet/ledger.go @@ -52,7 +52,7 @@ const ( ledgerOpSignTransaction ledgerOpcode = 0x04 // Signs an Ethereum transaction after having the user validate the parameters ledgerOpGetConfiguration ledgerOpcode = 0x06 // Returns specific wallet application configuration - ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet + ledgerP1DirectlyFetchAddress ledgerParam1 = 0x00 // Return address directly from the wallet ledgerP1InitTransactionData ledgerParam1 = 0x00 // First transaction data block for signing ledgerP1ContTransactionData ledgerParam1 = 0x80 // Subsequent transaction data block for signing ledgerP2DiscardAddressChainCode ledgerParam2 = 0x00 // Do not return the chain code along with the address diff --git a/core/asm/compiler.go b/core/asm/compiler.go index b430b6495c51..3059b0a21c8f 100644 --- a/core/asm/compiler.go +++ b/core/asm/compiler.go @@ -263,7 +263,6 @@ func (err compileError) Error() string { return fmt.Sprintf("%d syntax error: unexpected %v, expected %v", err.lineno, err.got, err.want) } - func compileErr(c token, got, want string) error { return compileError{ got: got, diff --git a/core/vm/instructions.go b/core/vm/instructions.go index bb313f2a3569..0689ee39cf34 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -29,8 +29,8 @@ import ( ) var ( - bigZero = new(big.Int) - tt255 = math.BigPow(2, 255) + bigZero = new(big.Int) + tt255 = math.BigPow(2, 255) errWriteProtection = errors.New("evm: write protection") errReturnDataOutOfBounds = errors.New("evm: return data out of bounds") errExecutionReverted = errors.New("evm: execution reverted") diff --git a/les/bloombits.go b/les/bloombits.go index 1b16f6de4320..2871a9006412 100644 --- a/les/bloombits.go +++ b/les/bloombits.go @@ -72,4 +72,3 @@ func (eth *LightEthereum) startBloomHandlers() { }() } } - diff --git a/les/sync.go b/les/sync.go index d32a3efb9cf0..c3d37e2f3f87 100644 --- a/les/sync.go +++ b/les/sync.go @@ -25,7 +25,6 @@ import ( "github.com/ethereum/go-ethereum/light" ) - // syncer is responsible for periodically synchronising with the network, both // downloading hashes and blocks as well as handling the announcement handler. func (pm *ProtocolManager) syncer() { diff --git a/p2p/discover/udp.go b/p2p/discover/udp.go index 025f81282e44..f6bcd9708571 100644 --- a/p2p/discover/udp.go +++ b/p2p/discover/udp.go @@ -49,7 +49,7 @@ var ( // Timeouts const ( respTimeout = 500 * time.Millisecond - expiration = 20 * time.Second + expiration = 20 * time.Second ntpFailureThreshold = 32 // Continuous timeouts after which to check NTP ntpWarningCooldown = 10 * time.Minute // Minimum amount of time to pass before repeating NTP warning diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go index 5b86698f2965..09e5f8b37409 100644 --- a/p2p/discv5/udp.go +++ b/p2p/discv5/udp.go @@ -38,13 +38,13 @@ const Version = 4 var ( errPacketTooSmall = errors.New("too small") errBadPrefix = errors.New("bad prefix") - errTimeout = errors.New("RPC timeout") + errTimeout = errors.New("RPC timeout") ) // Timeouts const ( respTimeout = 500 * time.Millisecond - expiration = 20 * time.Second + expiration = 20 * time.Second driftThreshold = 10 * time.Second // Allowed clock drift before warning user ) diff --git a/p2p/enr/enr.go b/p2p/enr/enr.go index 9244076c9695..c018895cc0ce 100644 --- a/p2p/enr/enr.go +++ b/p2p/enr/enr.go @@ -45,7 +45,7 @@ const SizeLimit = 300 // maximum encoded size of a node record in bytes const ID_SECP256k1_KECCAK = ID("secp256k1-keccak") // the default identity scheme var ( - errNoID = errors.New("unknown or unspecified identity scheme") + errNoID = errors.New("unknown or unspecified identity scheme") errInvalidSig = errors.New("invalid signature") errNotSorted = errors.New("record key/value pairs are not sorted by key") errDuplicateKey = errors.New("record contains duplicate key") diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 2efc02b59688..0552b84efa65 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -83,7 +83,6 @@ func NewNetStore(hash SwarmHasher, lstore *LocalStore, cloud CloudStore, params } } - var ( // timeout interval before retrieval is timed out searchTimeout = 3 * time.Second diff --git a/whisper/whisperv5/api.go b/whisper/whisperv5/api.go index 48bb817cb909..9fb22aa752ff 100644 --- a/whisper/whisperv5/api.go +++ b/whisper/whisperv5/api.go @@ -32,7 +32,6 @@ import ( "github.com/ethereum/go-ethereum/rpc" ) - var ( ErrSymAsym = errors.New("specify either a symmetric or an asymmetric key") ErrInvalidSymmetricKey = errors.New("invalid symmetric key") diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index d879b6d6952f..3f25785fec10 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -32,7 +32,6 @@ import ( "github.com/ethereum/go-ethereum/rpc" ) - // List of errors var ( ErrSymAsym = errors.New("specify either a symmetric or an asymmetric key") From 431af6b9700b0ac6c6a6dd42a9768e9245af2620 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Fri, 6 Apr 2018 16:48:42 +0200 Subject: [PATCH 10/15] build: run standard goimports on all files --- build/goimports.sh | 1 + consensus/consensus.go | 3 ++- swarm/fuse/fuse_dir.go | 7 ++++--- swarm/fuse/swarmfs.go | 3 ++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build/goimports.sh b/build/goimports.sh index 6bc848e20e18..29f7ea91121d 100755 --- a/build/goimports.sh +++ b/build/goimports.sh @@ -13,4 +13,5 @@ find_files() { } GOFMT="gofmt -s -w"; +GOFMT="goimports -w"; find_files | xargs $GOFMT; \ No newline at end of file diff --git a/consensus/consensus.go b/consensus/consensus.go index be5e661c12bc..5774af1a78eb 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -18,12 +18,13 @@ package consensus import ( + "math/big" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rpc" - "math/big" ) // ChainReader defines a small collection of methods needed to access the local diff --git a/swarm/fuse/fuse_dir.go b/swarm/fuse/fuse_dir.go index 91b236ae8af0..a7701985ebb6 100644 --- a/swarm/fuse/fuse_dir.go +++ b/swarm/fuse/fuse_dir.go @@ -19,12 +19,13 @@ package fuse import ( - "bazil.org/fuse" - "bazil.org/fuse/fs" - "golang.org/x/net/context" "os" "path/filepath" "sync" + + "bazil.org/fuse" + "bazil.org/fuse/fs" + "golang.org/x/net/context" ) var ( diff --git a/swarm/fuse/swarmfs.go b/swarm/fuse/swarmfs.go index 2493bdab19ba..e56d0ad4e39e 100644 --- a/swarm/fuse/swarmfs.go +++ b/swarm/fuse/swarmfs.go @@ -17,9 +17,10 @@ package fuse import ( - "github.com/ethereum/go-ethereum/swarm/api" "sync" "time" + + "github.com/ethereum/go-ethereum/swarm/api" ) const ( From ab0dcec27d917445851a275f7e0c5896d8a0dd82 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Fri, 6 Apr 2018 17:04:10 +0200 Subject: [PATCH 11/15] build: update script goimports+gofmt --- build/goimports.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/goimports.sh b/build/goimports.sh index 29f7ea91121d..6d67ef1f0f68 100755 --- a/build/goimports.sh +++ b/build/goimports.sh @@ -13,5 +13,6 @@ find_files() { } GOFMT="gofmt -s -w"; -GOFMT="goimports -w"; -find_files | xargs $GOFMT; \ No newline at end of file +GOIMPORTS="goimports -w"; +find_files | xargs $GOFMT; +find_files | xargs $GOIMPORTS; \ No newline at end of file From 639a37dc2899699d761cdad61cfbcd4823bf24b6 Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Mon, 9 Apr 2018 14:46:07 +0200 Subject: [PATCH 12/15] build: remove vendorcheck --- build/ci.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/ci.go b/build/ci.go index a2a6c91f2508..c9a68f762fe2 100644 --- a/build/ci.go +++ b/build/ci.go @@ -324,9 +324,6 @@ func doLint(cmdline []string) { } // Get metalinter and install all supported linters build.MustRun(goTool("get", "gopkg.in/alecthomas/gometalinter.v2")) - build.MustRun(goTool("get", "github.com/FiloSottile/vendorcheck")) - - build.MustRunCommand(filepath.Join(GOBIN, "vendorcheck"), "./...") build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), "--install") // Run fast linters batched together From db5d83a609e39e924d038d2714c450519207c80d Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Tue, 10 Apr 2018 13:02:49 +0200 Subject: [PATCH 13/15] build: remove vendorcheck --- Makefile | 2 +- core/tx_pool.go | 1 - p2p/discv5/net.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2c69839fea8c..5cb9231a1871 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ ios: test: all build/env.sh go run build/ci.go test -lint: ## Run linters. Use make install-linters first. +lint: ## Run linters. build/env.sh go run build/ci.go lint clean: diff --git a/core/tx_pool.go b/core/tx_pool.go index 6886326cc049..b074b3b8fce5 100644 --- a/core/tx_pool.go +++ b/core/tx_pool.go @@ -38,7 +38,6 @@ import ( const ( // chainHeadChanSize is the size of channel listening to ChainHeadEvent. chainHeadChanSize = 10 - // rmTxChanSize is the size of channel listening to RemovedTransactionEvent. ) var ( diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go index f56e0d320112..9b0bd0c80ac6 100644 --- a/p2p/discv5/net.go +++ b/p2p/discv5/net.go @@ -830,7 +830,7 @@ const ( // Packet type events. // These correspond to packet types in the UDP protocol. - pingPacket = iota + pingPacket = iota + 1 pongPacket findnodePacket neighborsPacket From 10ad506417aa04cfdc4618c92d26775feaad8e9d Mon Sep 17 00:00:00 2001 From: Thomas Modeneis Date: Tue, 10 Apr 2018 13:59:39 +0200 Subject: [PATCH 14/15] build: remove deadline on lint job --- build/ci.go | 1 - 1 file changed, 1 deletion(-) diff --git a/build/ci.go b/build/ci.go index c9a68f762fe2..0dd0a8abd892 100644 --- a/build/ci.go +++ b/build/ci.go @@ -337,7 +337,6 @@ func doLint(cmdline []string) { "--enable=gofmt", "--enable=misspell", "--enable=goconst", - "--deadline=5m", "--min-occurrences=6", // for goconst } build.MustRunCommand(filepath.Join(GOBIN, "gometalinter.v2"), append(configs, packages...)...) From fe98d8ce405b26e2fe434fa65766414e8de0900f Mon Sep 17 00:00:00 2001 From: thomasmodeneis Date: Thu, 12 Apr 2018 12:40:42 +0200 Subject: [PATCH 15/15] discv5: generate nodeevent --- p2p/discv5/nodeevent_string.go | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/p2p/discv5/nodeevent_string.go b/p2p/discv5/nodeevent_string.go index eb696fb8beef..38c1993bacbf 100644 --- a/p2p/discv5/nodeevent_string.go +++ b/p2p/discv5/nodeevent_string.go @@ -4,24 +4,14 @@ package discv5 import "strconv" -const ( - _nodeEvent_name_0 = "invalidEventpingPacketpongPacketfindnodePacketneighborsPacketfindnodeHashPackettopicRegisterPackettopicQueryPackettopicNodesPacket" - _nodeEvent_name_1 = "pongTimeoutpingTimeoutneighboursTimeout" -) +const _nodeEvent_name = "pongTimeoutpingTimeoutneighboursTimeout" -var ( - _nodeEvent_index_0 = [...]uint8{0, 12, 22, 32, 46, 61, 79, 98, 114, 130} - _nodeEvent_index_1 = [...]uint8{0, 11, 22, 39} -) +var _nodeEvent_index = [...]uint8{0, 11, 22, 39} func (i nodeEvent) String() string { - switch { - case 0 <= i && i <= 8: - return _nodeEvent_name_0[_nodeEvent_index_0[i]:_nodeEvent_index_0[i+1]] - case 265 <= i && i <= 267: - i -= 265 - return _nodeEvent_name_1[_nodeEvent_index_1[i]:_nodeEvent_index_1[i+1]] - default: - return "nodeEvent(" + strconv.FormatInt(int64(i), 10) + ")" + i -= 264 + if i >= nodeEvent(len(_nodeEvent_index)-1) { + return "nodeEvent(" + strconv.FormatInt(int64(i+264), 10) + ")" } + return _nodeEvent_name[_nodeEvent_index[i]:_nodeEvent_index[i+1]] }