diff --git a/Makefile b/Makefile index e9552dcafc..66aaa930e8 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,7 @@ GOTAGSLIST := sqlite_unlock_notify sqlite_omit_load_extension GOTAGSLIST += ${GOTAGSCUSTOM} GOTESTCOMMAND := go tool -modfile=tool.mod gotestsum --format pkgname --jsonfile testresults.json -- +GOLINTCOMMAND := go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.1 -c .golangci.yml ifeq ($(OS_TYPE), darwin) # M1 Mac--homebrew install location in /opt/homebrew @@ -97,6 +98,7 @@ default: build fmt: go fmt ./... + $(GOLINTCOMMAND) fmt ./scripts/check_license.sh -i fix: build @@ -106,7 +108,7 @@ modernize: GOTOOLCHAIN=auto go run golang.org/x/tools/go/analysis/passes/modernize/cmd/modernize@v0.39.0 -any=false -bloop=false -rangeint=false -fmtappendf=false -waitgroup=false -stringsbuilder=false -omitzero=false -fix ./... lint: - go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.1 run -c .golangci.yml + $(GOLINTCOMMAND) run warninglint: custom-golangci-lint ./custom-golangci-lint run -c .golangci-warnings.yml diff --git a/agreement/agreementtest/simulate_test.go b/agreement/agreementtest/simulate_test.go index 5c61a91af7..2c7d891cf2 100644 --- a/agreement/agreementtest/simulate_test.go +++ b/agreement/agreementtest/simulate_test.go @@ -26,9 +26,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/agreement/common_test.go b/agreement/common_test.go index 6081b2dde8..7d53727aa6 100644 --- a/agreement/common_test.go +++ b/agreement/common_test.go @@ -23,9 +23,10 @@ import ( "math/rand" "testing" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" diff --git a/agreement/cryptoVerifier_test.go b/agreement/cryptoVerifier_test.go index 8880adcf55..1d6206cc84 100644 --- a/agreement/cryptoVerifier_test.go +++ b/agreement/cryptoVerifier_test.go @@ -24,10 +24,11 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/account" diff --git a/agreement/fuzzer/dropMessageFilter_test.go b/agreement/fuzzer/dropMessageFilter_test.go index 832d54dc8e..71c77914b5 100644 --- a/agreement/fuzzer/dropMessageFilter_test.go +++ b/agreement/fuzzer/dropMessageFilter_test.go @@ -18,6 +18,7 @@ package fuzzer import ( "encoding/json" + "github.com/algorand/go-algorand/protocol" ) diff --git a/agreement/fuzzer/ledger_test.go b/agreement/fuzzer/ledger_test.go index 45a3ae743e..476115f1cf 100644 --- a/agreement/fuzzer/ledger_test.go +++ b/agreement/fuzzer/ledger_test.go @@ -22,6 +22,8 @@ import ( "maps" "math/rand" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" @@ -30,7 +32,6 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-deadlock" ) const randseed = 0 diff --git a/agreement/fuzzer/messageDelayFilter_test.go b/agreement/fuzzer/messageDelayFilter_test.go index b1c24c1621..aefe7a1bf6 100644 --- a/agreement/fuzzer/messageDelayFilter_test.go +++ b/agreement/fuzzer/messageDelayFilter_test.go @@ -19,6 +19,7 @@ package fuzzer import ( "container/heap" "encoding/json" + "github.com/algorand/go-deadlock" "github.com/algorand/go-algorand/protocol" diff --git a/agreement/fuzzer/messageDuplicationFilter_test.go b/agreement/fuzzer/messageDuplicationFilter_test.go index 00f4a65a14..22760f0fb1 100644 --- a/agreement/fuzzer/messageDuplicationFilter_test.go +++ b/agreement/fuzzer/messageDuplicationFilter_test.go @@ -20,8 +20,9 @@ import ( "container/heap" "encoding/json" - "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/protocol" ) // Duplicate message with delay diff --git a/agreement/fuzzer/messagePriorityQueue_test.go b/agreement/fuzzer/messagePriorityQueue_test.go index a0f65026c1..823c1f8a42 100644 --- a/agreement/fuzzer/messagePriorityQueue_test.go +++ b/agreement/fuzzer/messagePriorityQueue_test.go @@ -18,6 +18,7 @@ package fuzzer import ( "container/heap" + "github.com/algorand/go-algorand/protocol" ) diff --git a/agreement/fuzzer/messageReflectionFilter_test.go b/agreement/fuzzer/messageReflectionFilter_test.go index bf7e0c5428..ad4b3d6139 100644 --- a/agreement/fuzzer/messageReflectionFilter_test.go +++ b/agreement/fuzzer/messageReflectionFilter_test.go @@ -20,8 +20,9 @@ import ( "container/heap" "encoding/json" - "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/protocol" ) // Simulate a 2 way mirror where messages are passed through and also reflected back to sender with a delay diff --git a/agreement/proposalManager_test.go b/agreement/proposalManager_test.go index 5a5c1d0387..561d0978cc 100644 --- a/agreement/proposalManager_test.go +++ b/agreement/proposalManager_test.go @@ -19,9 +19,10 @@ package agreement import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // Creates a proposal manager, and returns it in automata and white box form, along diff --git a/agreement/service_test.go b/agreement/service_test.go index 27f35fba0f..4486ae8315 100644 --- a/agreement/service_test.go +++ b/agreement/service_test.go @@ -29,9 +29,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/account" diff --git a/catchup/service_test.go b/catchup/service_test.go index e7993225ca..a8ac63eca7 100644 --- a/catchup/service_test.go +++ b/catchup/service_test.go @@ -26,10 +26,11 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/cmd/algoh/blockWatcher_test.go b/cmd/algoh/blockWatcher_test.go index 8d3d2662ac..c271abef6f 100644 --- a/cmd/algoh/blockWatcher_test.go +++ b/cmd/algoh/blockWatcher_test.go @@ -22,10 +22,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/rpcs" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func bw(client Client) *blockWatcher { diff --git a/cmd/algoh/blockstats_test.go b/cmd/algoh/blockstats_test.go index cf848e96f4..b67128bcfc 100644 --- a/cmd/algoh/blockstats_test.go +++ b/cmd/algoh/blockstats_test.go @@ -20,13 +20,14 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/logging/telemetryspec" "github.com/algorand/go-algorand/rpcs" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) type event struct { diff --git a/cmd/catchupsrv/main.go b/cmd/catchupsrv/main.go index 6bfdae0f9f..b2b06d12e2 100644 --- a/cmd/catchupsrv/main.go +++ b/cmd/catchupsrv/main.go @@ -26,9 +26,10 @@ import ( "path" "strconv" - "github.com/algorand/websocket" "github.com/gorilla/mux" + "github.com/algorand/websocket" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" diff --git a/cmd/catchupsrv/tarblocks.go b/cmd/catchupsrv/tarblocks.go index a74b445806..97206b7ade 100644 --- a/cmd/catchupsrv/tarblocks.go +++ b/cmd/catchupsrv/tarblocks.go @@ -26,8 +26,9 @@ import ( "strconv" "strings" - "github.com/algorand/go-algorand/logging" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/logging" ) type tarBlockSet struct { diff --git a/cmd/dispenser/server.go b/cmd/dispenser/server.go index abdfb1e36c..a87ee089f8 100644 --- a/cmd/dispenser/server.go +++ b/cmd/dispenser/server.go @@ -18,7 +18,6 @@ package main import ( _ "embed" - // "bytes" "encoding/json" "flag" "fmt" diff --git a/cmd/goal/clerk.go b/cmd/goal/clerk.go index 23c4488b15..4a93692d57 100644 --- a/cmd/goal/clerk.go +++ b/cmd/goal/clerk.go @@ -27,6 +27,8 @@ import ( "strings" "time" + "github.com/spf13/cobra" + "github.com/algorand/go-algorand/cmd/util/datadir" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" @@ -41,8 +43,6 @@ import ( "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util" - - "github.com/spf13/cobra" ) var ( diff --git a/cmd/goal/commands_test.go b/cmd/goal/commands_test.go index 2cebf09eda..238c820561 100644 --- a/cmd/goal/commands_test.go +++ b/cmd/goal/commands_test.go @@ -20,9 +20,10 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/cmd/util/datadir" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestEnsureDataDirReturnsWhenDataDirIsProvided(t *testing.T) { // nolint:paralleltest // Sets shared OS environment variable. diff --git a/cmd/goal/tealsign.go b/cmd/goal/tealsign.go index 74b718ece2..a7b6f40a13 100644 --- a/cmd/goal/tealsign.go +++ b/cmd/goal/tealsign.go @@ -21,13 +21,13 @@ import ( "encoding/base64" "os" + "github.com/spf13/cobra" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" - - "github.com/spf13/cobra" ) var ( diff --git a/cmd/tealdbg/cdtdbg.go b/cmd/tealdbg/cdtdbg.go index ea38efff7f..297864888c 100644 --- a/cmd/tealdbg/cdtdbg.go +++ b/cmd/tealdbg/cdtdbg.go @@ -23,9 +23,10 @@ import ( "net/http" "time" - "github.com/algorand/go-deadlock" "github.com/gorilla/mux" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/cmd/tealdbg/cdt" ) diff --git a/cmd/tealdbg/webdbg.go b/cmd/tealdbg/webdbg.go index 9d4dde8b44..e15e4a3220 100644 --- a/cmd/tealdbg/webdbg.go +++ b/cmd/tealdbg/webdbg.go @@ -25,10 +25,12 @@ import ( "log" "net/http" - "github.com/algorand/go-algorand/protocol" + "github.com/gorilla/mux" + "github.com/algorand/go-deadlock" "github.com/algorand/websocket" - "github.com/gorilla/mux" + + "github.com/algorand/go-algorand/protocol" ) // WebPageFrontend is web page debugging frontend diff --git a/crypto/encoding_test.go b/crypto/encoding_test.go index 1a72fcad2d..6761f0be17 100644 --- a/crypto/encoding_test.go +++ b/crypto/encoding_test.go @@ -20,8 +20,6 @@ import ( "testing" "github.com/algorand/go-algorand/test/partitiontest" - // "github.com/stretchr/testify/require" - // "github.com/algorand/go-algorand/protocol" ) func TestEmptyEncoding(t *testing.T) { diff --git a/crypto/util_test.go b/crypto/util_test.go index 7c5184ae4e..3214264331 100644 --- a/crypto/util_test.go +++ b/crypto/util_test.go @@ -20,9 +20,10 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestEncodeDecode(t *testing.T) { diff --git a/daemon/algod/api/server/v2/dryrun.go b/daemon/algod/api/server/v2/dryrun.go index c940709296..0bf1ca253f 100644 --- a/daemon/algod/api/server/v2/dryrun.go +++ b/daemon/algod/api/server/v2/dryrun.go @@ -27,10 +27,9 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" + "github.com/algorand/go-algorand/ledger" "github.com/algorand/go-algorand/ledger/apply" "github.com/algorand/go-algorand/ledger/ledgercore" - - "github.com/algorand/go-algorand/ledger" "github.com/algorand/go-algorand/protocol" ) diff --git a/daemon/algod/api/server/v2/utils.go b/daemon/algod/api/server/v2/utils.go index b2757e375d..2d26d401ac 100644 --- a/daemon/algod/api/server/v2/utils.go +++ b/daemon/algod/api/server/v2/utils.go @@ -27,9 +27,10 @@ import ( "unicode" "unicode/utf8" - "github.com/algorand/go-codec/codec" "github.com/labstack/echo/v4" + "github.com/algorand/go-codec/codec" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" "github.com/algorand/go-algorand/data/basics" diff --git a/daemon/kmd/server/server.go b/daemon/kmd/server/server.go index 1c441a9c71..e2cec6c8dc 100644 --- a/daemon/kmd/server/server.go +++ b/daemon/kmd/server/server.go @@ -26,9 +26,10 @@ import ( "syscall" "time" - "github.com/algorand/go-deadlock" "github.com/gofrs/flock" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/daemon/kmd/api" "github.com/algorand/go-algorand/daemon/kmd/session" "github.com/algorand/go-algorand/logging" diff --git a/daemon/kmd/session/session.go b/daemon/kmd/session/session.go index 3e6580228d..8d9009769b 100644 --- a/daemon/kmd/session/session.go +++ b/daemon/kmd/session/session.go @@ -20,9 +20,10 @@ import ( "context" "time" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/daemon/kmd/config" "github.com/algorand/go-algorand/daemon/kmd/wallet" - "github.com/algorand/go-deadlock" ) type walletHandle struct { diff --git a/daemon/kmd/wallet/driver/sqlite.go b/daemon/kmd/wallet/driver/sqlite.go index 67099647a3..77b4ce9335 100644 --- a/daemon/kmd/wallet/driver/sqlite.go +++ b/daemon/kmd/wallet/driver/sqlite.go @@ -24,10 +24,12 @@ import ( "path/filepath" "regexp" - "github.com/algorand/go-deadlock" "github.com/jmoiron/sqlx" "github.com/mattn/go-sqlite3" + "github.com/algorand/go-codec/codec" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/daemon/kmd/config" "github.com/algorand/go-algorand/daemon/kmd/wallet" @@ -35,7 +37,6 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-codec/codec" ) const ( diff --git a/data/transactions/logic/backwardCompat_test.go b/data/transactions/logic/backwardCompat_test.go index 7aab034ccb..8f9bffd1a1 100644 --- a/data/transactions/logic/backwardCompat_test.go +++ b/data/transactions/logic/backwardCompat_test.go @@ -22,11 +22,12 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // This test ensures a program compiled with by pre-AVM v2 go-algorand diff --git a/ledger/ledger_perf_test.go b/ledger/ledger_perf_test.go index 754b8319da..f77145ab7d 100644 --- a/ledger/ledger_perf_test.go +++ b/ledger/ledger_perf_test.go @@ -24,9 +24,10 @@ import ( "strings" "testing" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/ledger/perf_test.go b/ledger/perf_test.go index 7b76483d33..d8cf5f6497 100644 --- a/ledger/perf_test.go +++ b/ledger/perf_test.go @@ -21,9 +21,10 @@ import ( "fmt" "testing" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/logging/telemetryCommon.go b/logging/telemetryCommon.go index a7d087d1aa..695acdee8d 100644 --- a/logging/telemetryCommon.go +++ b/logging/telemetryCommon.go @@ -20,8 +20,9 @@ import ( "context" "sync" - "github.com/algorand/go-deadlock" "github.com/sirupsen/logrus" + + "github.com/algorand/go-deadlock" ) type telemetryHook interface { diff --git a/network/wsNetwork.go b/network/wsNetwork.go index 765bdd93dd..10a8b3511d 100644 --- a/network/wsNetwork.go +++ b/network/wsNetwork.go @@ -38,9 +38,10 @@ import ( "sync/atomic" "time" + "github.com/gorilla/mux" + "github.com/algorand/go-deadlock" "github.com/algorand/websocket" - "github.com/gorilla/mux" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/network/wsPeer_test.go b/network/wsPeer_test.go index d3e3cd3fdb..6f9f52817f 100644 --- a/network/wsPeer_test.go +++ b/network/wsPeer_test.go @@ -32,11 +32,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/metrics" - "github.com/stretchr/testify/require" ) func TestCheckSlowWritingPeer(t *testing.T) { diff --git a/rpcs/blockService.go b/rpcs/blockService.go index 97f0a43af7..29a35c3560 100644 --- a/rpcs/blockService.go +++ b/rpcs/blockService.go @@ -31,7 +31,6 @@ import ( "github.com/gorilla/mux" "github.com/algorand/go-codec/codec" - "github.com/algorand/go-deadlock" "github.com/algorand/go-algorand/agreement" diff --git a/test/e2e-go/cli/tealdbg/cdtmock/main.go b/test/e2e-go/cli/tealdbg/cdtmock/main.go index 77a889661d..261b88e13a 100644 --- a/test/e2e-go/cli/tealdbg/cdtmock/main.go +++ b/test/e2e-go/cli/tealdbg/cdtmock/main.go @@ -18,7 +18,6 @@ package main import ( "fmt" - "net/http" "os" "strings" diff --git a/test/e2e-go/features/multisig/multisig_test.go b/test/e2e-go/features/multisig/multisig_test.go index 87d94adebb..5ffe729f7c 100644 --- a/test/e2e-go/features/multisig/multisig_test.go +++ b/test/e2e-go/features/multisig/multisig_test.go @@ -20,11 +20,12 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // create a 2 out of 3 multisig address diff --git a/test/framework/fixtures/libgoalFixture.go b/test/framework/fixtures/libgoalFixture.go index 38d3b3ec4d..d0aec4625d 100644 --- a/test/framework/fixtures/libgoalFixture.go +++ b/test/framework/fixtures/libgoalFixture.go @@ -28,9 +28,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklearray" diff --git a/tools/block-generator/core/commands.go b/tools/block-generator/core/commands.go index a67fc80e95..a3be48c9d1 100644 --- a/tools/block-generator/core/commands.go +++ b/tools/block-generator/core/commands.go @@ -17,9 +17,10 @@ package core import ( + "github.com/spf13/cobra" + "github.com/algorand/go-algorand/tools/block-generator/generator" "github.com/algorand/go-algorand/tools/block-generator/runner" - "github.com/spf13/cobra" ) // BlockGenerator related cobra commands, ready to be executed or included as subcommands. diff --git a/tools/block-generator/generator/config_test.go b/tools/block-generator/generator/config_test.go index dd8ba9919a..4c71df5971 100644 --- a/tools/block-generator/generator/config_test.go +++ b/tools/block-generator/generator/config_test.go @@ -21,8 +21,9 @@ import ( "os" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestInitConfigFile(t *testing.T) { diff --git a/tools/block-generator/generator/generator_ledger.go b/tools/block-generator/generator/generator_ledger.go index b9e08f9554..14b7edc4ad 100644 --- a/tools/block-generator/generator/generator_ledger.go +++ b/tools/block-generator/generator/generator_ledger.go @@ -25,6 +25,7 @@ import ( "time" "github.com/algorand/avm-abi/apps" + cconfig "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" diff --git a/tools/block-generator/generator/server_test.go b/tools/block-generator/generator/server_test.go index 2c318e0e96..ec1eb1dd8c 100644 --- a/tools/block-generator/generator/server_test.go +++ b/tools/block-generator/generator/server_test.go @@ -21,9 +21,10 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestParseURL(t *testing.T) { diff --git a/tools/block-generator/generator/utils.go b/tools/block-generator/generator/utils.go index e40365a47c..01932a1772 100644 --- a/tools/block-generator/generator/utils.go +++ b/tools/block-generator/generator/utils.go @@ -21,8 +21,9 @@ import ( "fmt" "math/rand" - "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-codec/codec" + + "github.com/algorand/go-algorand/data/basics" ) func weightedSelection(weights []float32, options []interface{}, defaultOption interface{}) (selection interface{}, err error) { diff --git a/tools/block-generator/generator/utils_test.go b/tools/block-generator/generator/utils_test.go index 73148fcb4b..14be5beffd 100644 --- a/tools/block-generator/generator/utils_test.go +++ b/tools/block-generator/generator/utils_test.go @@ -20,9 +20,10 @@ import ( "fmt" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestWeightedSelectionInternalBadInput(t *testing.T) { diff --git a/tools/block-generator/runner/run.go b/tools/block-generator/runner/run.go index 529629a386..0176b0e1bd 100644 --- a/tools/block-generator/runner/run.go +++ b/tools/block-generator/runner/run.go @@ -19,18 +19,16 @@ package runner import ( "bytes" "context" + _ "embed" // embed conduit template config file "encoding/json" - "io" - "sort" - - // embed conduit template config file - _ "embed" "fmt" + "io" "net/http" "os" "os/exec" "path" "path/filepath" + "sort" "strconv" "strings" "text/template" diff --git a/tools/block-generator/runner/runner.go b/tools/block-generator/runner/runner.go index 06252006a9..e1d2d29f0a 100644 --- a/tools/block-generator/runner/runner.go +++ b/tools/block-generator/runner/runner.go @@ -35,7 +35,7 @@ func init() { Use: "runner", Short: "Run test suite and collect results.", Long: "Run an automated test suite using the block-generator daemon and a provided conduit binary. Results are captured to a specified output directory.", - RunE: func(cmd *cobra.Command, args []string) error{ + RunE: func(cmd *cobra.Command, args []string) error { fmt.Printf("starting block-generator runner with args: %+v\n", runnerArgs) if runnerArgs.Template == "postgres-exporter" && runnerArgs.PostgresConnectionString == "" { diff --git a/tools/block-generator/util/util.go b/tools/block-generator/util/util.go index c447730194..3f909afdf6 100644 --- a/tools/block-generator/util/util.go +++ b/tools/block-generator/util/util.go @@ -24,10 +24,10 @@ import ( "os" "strings" - "github.com/algorand/go-algorand/data/basics" - // import postgres driver _ "github.com/lib/pq" + + "github.com/algorand/go-algorand/data/basics" ) // ErrorNotInitialized is returned when the database is not initialized. diff --git a/tools/debug/algodump/compress.go b/tools/debug/algodump/compress.go index a0aed9566a..3fbebc7b90 100644 --- a/tools/debug/algodump/compress.go +++ b/tools/debug/algodump/compress.go @@ -31,15 +31,17 @@ import ( "time" "github.com/DataDog/zstd" + kzstd "github.com/klauspost/compress/zstd" + "github.com/valyala/gozstd" + + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/network/vpack" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-deadlock" - kzstd "github.com/klauspost/compress/zstd" - "github.com/valyala/gozstd" ) // Compression-specific flags diff --git a/tools/debug/algodump/compress_bench_test.go b/tools/debug/algodump/compress_bench_test.go index f1ce7c5ece..858d12303b 100644 --- a/tools/debug/algodump/compress_bench_test.go +++ b/tools/debug/algodump/compress_bench_test.go @@ -32,10 +32,11 @@ import ( "testing" "github.com/DataDog/zstd" - "github.com/algorand/go-algorand/network/vpack" - "github.com/algorand/go-algorand/protocol" kzstd "github.com/klauspost/compress/zstd" "github.com/valyala/gozstd" + + "github.com/algorand/go-algorand/network/vpack" + "github.com/algorand/go-algorand/protocol" ) // testCorpus holds all the test data loaded from message files diff --git a/tools/network/dnssec/dnssec_test.go b/tools/network/dnssec/dnssec_test.go index bd5b913603..d99fb0e93b 100644 --- a/tools/network/dnssec/dnssec_test.go +++ b/tools/network/dnssec/dnssec_test.go @@ -22,10 +22,11 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/logging" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLookup(t *testing.T) { diff --git a/tools/network/dnssec/trustchain.go b/tools/network/dnssec/trustchain.go index 8daa1a933c..e952a1c5a1 100644 --- a/tools/network/dnssec/trustchain.go +++ b/tools/network/dnssec/trustchain.go @@ -22,8 +22,9 @@ import ( "strings" "time" - "github.com/algorand/go-deadlock" "github.com/miekg/dns" + + "github.com/algorand/go-deadlock" ) // TrustQuerier wraps Querier and trusted root anchor retrieval for better testability diff --git a/tools/x-repo-types/typeAnalyzer/main.go b/tools/x-repo-types/typeAnalyzer/main.go index a2eec918e1..92bb39a462 100644 --- a/tools/x-repo-types/typeAnalyzer/main.go +++ b/tools/x-repo-types/typeAnalyzer/main.go @@ -24,9 +24,8 @@ package main import ( "fmt" - "os" - xpkg "net/http" + "os" ypkg "time" ) diff --git a/tools/x-repo-types/typeAnalyzer/typeAnalyzer_test.go b/tools/x-repo-types/typeAnalyzer/typeAnalyzer_test.go index c51f2709f3..238ffa4c40 100644 --- a/tools/x-repo-types/typeAnalyzer/typeAnalyzer_test.go +++ b/tools/x-repo-types/typeAnalyzer/typeAnalyzer_test.go @@ -20,8 +20,9 @@ import ( "fmt" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEdgeFromLabel(t *testing.T) { diff --git a/tools/x-repo-types/xrt.go b/tools/x-repo-types/xrt.go index 51b5577afa..1ea4f8bdb2 100644 --- a/tools/x-repo-types/xrt.go +++ b/tools/x-repo-types/xrt.go @@ -18,6 +18,7 @@ package main import ( "bytes" + _ "embed" "errors" "fmt" "log" @@ -28,8 +29,6 @@ import ( "text/template" "github.com/spf13/cobra" - - _ "embed" ) //go:embed typeAnalyzer/main.tmpl diff --git a/tools/x-repo-types/xrt_test.go b/tools/x-repo-types/xrt_test.go index 19a3c74c7b..2d28fbb311 100644 --- a/tools/x-repo-types/xrt_test.go +++ b/tools/x-repo-types/xrt_test.go @@ -19,8 +19,9 @@ package main import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) type testCase struct {