Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,15 @@ severity:

formatters:
enable:
- gci
- gofmt
settings:
gci:
sections:
- standard
- default
- prefix(github.com/algorand)
- prefix(github.com/algorand/go-algorand)
exclusions:
generated: lax
paths:
Expand Down
3 changes: 2 additions & 1 deletion agreement/credentialArrivalHistory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"testing"
"time"

"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/test/partitiontest"
)

func TestCredentialHistoryStore(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion agreement/dynamicFilterTimeoutParams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"testing"
"time"

"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/test/partitiontest"
)

func TestSampleIndexIsValid(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion agreement/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"encoding/base64"
"testing"

"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/require"
)

// TestSerializableErrorBackwardCompatibility ensures Err field of type serializableError can be
Expand Down
3 changes: 1 addition & 2 deletions agreement/fuzzer/tests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"math"
"math/rand"
"os"

//ossignal "os/signal"
"path/filepath"
//"runtime/pprof"
Expand All @@ -34,9 +33,9 @@ import (

"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/logging"
"github.com/algorand/go-deadlock"

"github.com/algorand/go-algorand/logging"
//"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/test/partitiontest"
)
Expand Down
3 changes: 2 additions & 1 deletion agreement/proposalTracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (
"sort"
"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 sortedVoteGen(t *testing.T) (votes []vote) {
Expand Down
3 changes: 2 additions & 1 deletion agreement/sort_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ package agreement
import (
"testing"

"github.com/stretchr/testify/require"

"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"
)

func TestSortProposalValueLess(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion catchup/classBasedPeerSelector.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"errors"
"time"

"github.com/algorand/go-algorand/network"
"github.com/algorand/go-deadlock"

"github.com/algorand/go-algorand/network"
)

// classBasedPeerSelector is a rankPooledPeerSelector that tracks and ranks classes of peers based on their response behavior.
Expand Down
3 changes: 2 additions & 1 deletion catchup/classBasedPeerSelector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/network"
"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/require"
)

// Use to mock the wrapped peer selectors where warranted
Expand Down
3 changes: 2 additions & 1 deletion cmd/algocfg/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"fmt"
"os"

"github.com/algorand/go-algorand/cmd/util/datadir"
"github.com/spf13/cobra"

"github.com/algorand/go-algorand/cmd/util/datadir"
)

func init() {
Expand Down
3 changes: 1 addition & 2 deletions cmd/algocfg/profileCommand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ package main
import (
"testing"

"github.com/algorand/go-algorand/config"

"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/test/partitiontest"
)

Expand Down
7 changes: 4 additions & 3 deletions cmd/algod/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ import (
"strings"
"time"

"github.com/gofrs/flock"

"github.com/algorand/go-deadlock"

"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/crypto"
"github.com/algorand/go-algorand/daemon/algod"
Expand All @@ -41,9 +45,6 @@ import (
"github.com/algorand/go-algorand/util"
"github.com/algorand/go-algorand/util/metrics"
"github.com/algorand/go-algorand/util/tokens"
"github.com/gofrs/flock"

"github.com/algorand/go-deadlock"
)

var dataDirectory = flag.String("d", "", "Root Algorand daemon data path")
Expand Down
3 changes: 2 additions & 1 deletion cmd/algofix/deadlock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import (
"strings"
"testing"

"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/test/partitiontest"
)

const deadlockSimpleSrc = `package main
Expand Down
3 changes: 2 additions & 1 deletion cmd/catchpointdump/bench_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import (
"runtime"
"time"

"github.com/algorand/go-algorand/util"
"github.com/google/uuid"
"github.com/klauspost/cpuid/v2"

"github.com/algorand/go-algorand/util"
)

type benchStage struct {
Expand Down
1 change: 1 addition & 0 deletions cmd/catchpointdump/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/spf13/cobra"

"github.com/algorand/avm-abi/apps"

cmdutil "github.com/algorand/go-algorand/cmd/util"
"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/crypto"
Expand Down
3 changes: 2 additions & 1 deletion cmd/catchupsrv/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

func TestBlockToPath(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions cmd/dispenser/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ package main

import (
_ "embed"
"html"

// "bytes"
"encoding/json"
"flag"
"fmt"
"html"
"io"
"log"
"net/http"
Expand Down
1 change: 1 addition & 0 deletions cmd/goal/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (

"github.com/algorand/avm-abi/abi"
"github.com/algorand/avm-abi/apps"

"github.com/algorand/go-algorand/cmd/util/datadir"
"github.com/algorand/go-algorand/crypto"
apiclient "github.com/algorand/go-algorand/daemon/algod/api/client"
Expand Down
3 changes: 2 additions & 1 deletion cmd/goal/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (
"slices"
"testing"

"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/data/basics"
"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/require"
)

func TestParseMethodArgJSONtoByteSlice(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/goal/clerk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"path/filepath"
"testing"

"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/test/partitiontest"
)

func abs(t *testing.T, path string) string {
Expand Down
3 changes: 2 additions & 1 deletion cmd/goal/formatting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package main
import (
"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 TestUnicodePrintable(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions cmd/goal/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (
"strings"
"testing"

"github.com/algorand/go-algorand/ledger/ledgercore"
"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/ledger/ledgercore"
"github.com/algorand/go-algorand/test/partitiontest"
)

var isNum = regexp.MustCompile(`^[0-9]+$`)
Expand Down
5 changes: 3 additions & 2 deletions cmd/goal/p2pid.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import (
"os"
"path"

"github.com/libp2p/go-libp2p/core/peer"
"github.com/spf13/cobra"

"github.com/algorand/go-algorand/cmd/util/datadir"
"github.com/algorand/go-algorand/config"
"github.com/algorand/go-algorand/network/p2p"
"github.com/algorand/go-algorand/util"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/spf13/cobra"
)

var p2pID = &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions cmd/netgoal/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
"fmt"
"os"

"github.com/algorand/go-deadlock"

"github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/algorand/go-deadlock"
)

var log *logrus.Logger
Expand Down
5 changes: 2 additions & 3 deletions cmd/tealdbg/dryrunRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ package main
import (
"log"

"github.com/algorand/go-algorand/data/basics"
"github.com/algorand/go-algorand/protocol"

v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2"
"github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model"
"github.com/algorand/go-algorand/data/basics"
"github.com/algorand/go-algorand/protocol"
)

// ddrFromParams converts serialized DryrunRequest to v2.DryrunRequest
Expand Down
5 changes: 3 additions & 2 deletions cmd/tealdbg/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/config"
v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2"
"github.com/algorand/go-algorand/data/basics"
Expand All @@ -35,8 +38,6 @@ import (
"github.com/algorand/go-algorand/ledger/apply"
"github.com/algorand/go-algorand/protocol"
"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

var txnSample string = `{
Expand Down
6 changes: 4 additions & 2 deletions cmd/tealdbg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ import (
"strings"
"time"

"github.com/algorand/go-algorand/data/basics"
"github.com/algorand/websocket"
"github.com/gorilla/mux"

"github.com/algorand/websocket"

"github.com/algorand/go-algorand/data/basics"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion cmd/tealdbg/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"testing"
"time"

"github.com/algorand/go-algorand/test/partitiontest"
"github.com/gorilla/mux"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/test/partitiontest"
)

type mockFactory struct{}
Expand Down
3 changes: 2 additions & 1 deletion cmd/tealdbg/webdbg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"net/http/httptest"
"testing"

"github.com/algorand/go-algorand/test/partitiontest"
"github.com/gorilla/mux"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/test/partitiontest"
)

func TestWebPageFrontendHandlers(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion config/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ package config
import (
"testing"

"github.com/algorand/go-algorand/test/partitiontest"
"github.com/stretchr/testify/require"

"github.com/algorand/go-algorand/test/partitiontest"
)

func TestConsensusParams(t *testing.T) {
Expand Down
Loading
Loading