Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork sort Package from Go 1.13 to Ensure Stability Across Go Versions #487

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion accounts/keystore/account_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"fmt"
"os"
"path/filepath"
"sort"
"strings"
"sync"
"time"
Expand All @@ -31,6 +30,7 @@ import (
"github.com/tomochain/tomochain/accounts"
"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/sort"
)

// Minimum amount of time between cache reloads. This limit applies if the platform does
Expand Down
4 changes: 2 additions & 2 deletions accounts/keystore/account_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ import (
"math/rand"
"os"
"path/filepath"
"reflect"
"sort"
"reflect"
"testing"
"time"

"github.com/cespare/cp"
"github.com/davecgh/go-spew/spew"
"github.com/tomochain/tomochain/accounts"
"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/sort"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion accounts/keystore/keystore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
"math/rand"
"os"
"runtime"
"sort"
"strings"
"testing"
"time"

"github.com/tomochain/tomochain/accounts"
"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/event"
"github.com/tomochain/tomochain/sort"
)

var testSigData = make([]byte, 32)
Expand Down
4 changes: 2 additions & 2 deletions accounts/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package accounts

import (
"reflect"
"sort"
"reflect"
"sync"

"github.com/tomochain/tomochain/event"
"github.com/tomochain/tomochain/sort"
)

// Manager is an overarching account manager that can communicate with various
Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/wizard.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"net"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
"sync"
Expand All @@ -34,6 +33,7 @@ import (
"github.com/tomochain/tomochain/core"
"github.com/tomochain/tomochain/log"
"golang.org/x/crypto/ssh/terminal"
"github.com/tomochain/tomochain/sort"
)

// config contains all the configurations needed by puppeth that should be saved
Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/wizard_ethstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package main

import (
"fmt"
"sort"

"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/sort"
)

// deployEthstats queries the user for various input on deploying an ethstats
Expand Down
2 changes: 1 addition & 1 deletion cmd/puppeth/wizard_netstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ package main
import (
"encoding/json"
"os"
"sort"
"strings"
"sync"

"github.com/olekukonko/tablewriter"
"github.com/tomochain/tomochain/core"
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/sort"
)

// networkStats verifies the status of network components and generates a protip
Expand Down
2 changes: 1 addition & 1 deletion cmd/swarm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"os"
"os/signal"
"runtime"
"sort"
"strconv"
"strings"
"syscall"
Expand All @@ -44,6 +43,7 @@ import (
"github.com/tomochain/tomochain/swarm"
bzzapi "github.com/tomochain/tomochain/swarm/api"
swarmmetrics "github.com/tomochain/tomochain/swarm/metrics"
"github.com/tomochain/tomochain/sort"

"gopkg.in/urfave/cli.v1"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/tomo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"fmt"
"os"
"runtime"
"sort"
"strings"
"time"

Expand All @@ -36,6 +35,7 @@ import (
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/metrics"
"github.com/tomochain/tomochain/node"
"github.com/tomochain/tomochain/sort"
"gopkg.in/urfave/cli.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/tomo/monitorcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (
"math"
"reflect"
"runtime"
"sort"
"strings"
"time"

"github.com/gizak/termui"
"github.com/tomochain/tomochain/cmd/utils"
"github.com/tomochain/tomochain/node"
"github.com/tomochain/tomochain/rpc"
"github.com/tomochain/tomochain/sort"
"gopkg.in/urfave/cli.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/tomo/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ package main

import (
"io"
"sort"

"github.com/tomochain/tomochain/cmd/utils"
"github.com/tomochain/tomochain/internal/debug"
"github.com/tomochain/tomochain/sort"
"gopkg.in/urfave/cli.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion consensus/posv/posv.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"math/rand"
"path/filepath"
"reflect"
"sort"
"strconv"
"sync"
"time"
Expand All @@ -51,6 +50,7 @@ import (
"github.com/tomochain/tomochain/params"
"github.com/tomochain/tomochain/rlp"
"github.com/tomochain/tomochain/rpc"
"github.com/tomochain/tomochain/sort"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"os/signal"
"path/filepath"
"regexp"
"sort"
"strings"
"syscall"

Expand All @@ -35,6 +34,7 @@ import (
"github.com/tomochain/tomochain/internal/jsre/deps"
"github.com/tomochain/tomochain/internal/web3ext"
"github.com/tomochain/tomochain/rpc"
"github.com/tomochain/tomochain/sort"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"io"
"math/big"
"os"
"sort"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -51,6 +50,7 @@ import (
"github.com/tomochain/tomochain/params"
"github.com/tomochain/tomochain/rlp"
"github.com/tomochain/tomochain/trie"
"github.com/tomochain/tomochain/sort"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
)

Expand Down
2 changes: 1 addition & 1 deletion core/bloombits/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
"context"
"errors"
"math"
"sort"
"sync"
"sync/atomic"
"time"

"github.com/tomochain/tomochain/common/bitutil"
"github.com/tomochain/tomochain/crypto"
"github.com/tomochain/tomochain/sort"
)

// bloomIndexes represents the bit indexes inside the bloom filter that belong
Expand Down
2 changes: 1 addition & 1 deletion core/lending_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"errors"
"fmt"
"math/big"
"sort"
"sync"
"time"

Expand All @@ -35,6 +34,7 @@ import (
"github.com/tomochain/tomochain/event"
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/params"
"github.com/tomochain/tomochain/sort"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
)

Expand Down
2 changes: 1 addition & 1 deletion core/lending_tx_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package core

import (
"container/heap"
"sort"

"github.com/tomochain/tomochain/core/types"
"github.com/tomochain/tomochain/sort"
)

// txSortedMap is a nonce->transaction hash map with a heap based index to allow
Expand Down
2 changes: 1 addition & 1 deletion core/mkalloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ import (
"fmt"
"math/big"
"os"
"sort"
"strconv"

"github.com/tomochain/tomochain/core"
"github.com/tomochain/tomochain/rlp"
"github.com/tomochain/tomochain/sort"
)

type allocItem struct{ Addr, Balance *big.Int }
Expand Down
2 changes: 1 addition & 1 deletion core/order_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"errors"
"fmt"
"math/big"
"sort"
"sync"
"time"

Expand All @@ -34,6 +33,7 @@ import (
"github.com/tomochain/tomochain/event"
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/params"
"github.com/tomochain/tomochain/sort"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
)

Expand Down
2 changes: 1 addition & 1 deletion core/order_tx_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ package core

import (
"container/heap"
"sort"

"github.com/tomochain/tomochain/core/types"
"github.com/tomochain/tomochain/sort"
)

// txSortedMap is a nonce->transaction hash map with a heap based index to allow
Expand Down
2 changes: 1 addition & 1 deletion core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package state
import (
"fmt"
"math/big"
"sort"
"sync"

"github.com/tomochain/tomochain/common"
Expand All @@ -29,6 +28,7 @@ import (
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/rlp"
"github.com/tomochain/tomochain/trie"
"github.com/tomochain/tomochain/sort"
)

type revision struct {
Expand Down
2 changes: 1 addition & 1 deletion core/tx_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
"container/heap"
"math"
"math/big"
"sort"

"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/core/types"
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/sort"
)

// nonceHeap is a heap.Interface implementation over 64bit unsigned integers for
Expand Down
2 changes: 1 addition & 1 deletion core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/tomochain/tomochain/consensus"
"math"
"math/big"
"sort"
"sync"
"time"

Expand All @@ -33,6 +32,7 @@ import (
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/metrics"
"github.com/tomochain/tomochain/params"
"github.com/tomochain/tomochain/sort"
"gopkg.in/karalabe/cookiejar.v2/collections/prque"
)

Expand Down
2 changes: 1 addition & 1 deletion core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"fmt"
"io"
"math/big"
"sort"
"sync/atomic"
"time"
"unsafe"
Expand All @@ -31,6 +30,7 @@ import (
"github.com/tomochain/tomochain/common/hexutil"
"github.com/tomochain/tomochain/crypto/sha3"
"github.com/tomochain/tomochain/rlp"
"github.com/tomochain/tomochain/sort"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"fmt"
"math/big"
"runtime"
"sort"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -62,6 +61,7 @@ import (
"github.com/tomochain/tomochain/params"
"github.com/tomochain/tomochain/rpc"
"github.com/tomochain/tomochain/tomox"
"github.com/tomochain/tomochain/sort"
)

type LesServer interface {
Expand Down
2 changes: 1 addition & 1 deletion eth/downloader/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import (
"fmt"
"math"
"math/big"
"sort"
"sync"
"sync/atomic"
"time"

"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/event"
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/sort"
)

const (
Expand Down
Loading