Skip to content

Commit

Permalink
all: use the built-in slices library (#10005)
Browse files Browse the repository at this point in the history
Signed-off-by: carehabit <shenyuting@outlook.com>
  • Loading branch information
carehabit authored and 0xfuturistic committed Apr 1, 2024
1 parent 28d5526 commit ef86c58
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion op-batcher/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package flags

import (
"fmt"
"slices"
"strings"
"time"

"github.com/urfave/cli/v2"
"golang.org/x/exp/slices"

"github.com/ethereum-optimism/optimism/op-batcher/compressor"
plasma "github.com/ethereum-optimism/optimism/op-plasma"
Expand Down
2 changes: 1 addition & 1 deletion op-challenger/game/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"fmt"
"os"
"path/filepath"
"slices"
"strings"

"github.com/ethereum/go-ethereum/common"
"golang.org/x/exp/slices"
)

const gameDirPrefix = "game-"
Expand Down
2 changes: 1 addition & 1 deletion op-challenger/game/scheduler/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"errors"
"fmt"
"slices"

"github.com/ethereum-optimism/optimism/op-challenger/game/types"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"golang.org/x/exp/slices"
)

var errUnknownGame = errors.New("unknown game")
Expand Down
2 changes: 1 addition & 1 deletion op-challenger/game/scheduler/coordinator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package scheduler
import (
"context"
"fmt"
"slices"
"testing"

"github.com/ethereum-optimism/optimism/op-challenger/game/scheduler/test"
Expand All @@ -11,7 +12,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"
)

func TestScheduleNewGames(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion op-e2e/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/big"
"os"
"runtime"
"slices"
"testing"
"time"

Expand All @@ -28,7 +29,6 @@ import (

"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"

"github.com/ethereum-optimism/optimism/op-bindings/bindings"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
Expand Down
2 changes: 1 addition & 1 deletion op-node/node/superchain_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package node

import (
"slices"
"testing"

"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"

"github.com/ethereum/go-ethereum/params"
)
Expand Down
2 changes: 1 addition & 1 deletion op-node/p2p/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/rand"
"math/big"
"net"
"slices"
"testing"
"time"

Expand All @@ -17,7 +18,6 @@ import (
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
ma "github.com/multiformats/go-multiaddr"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
Expand Down
2 changes: 1 addition & 1 deletion op-node/rollup/derive/channel_bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package derive
import (
"context"
"io"
"slices"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"golang.org/x/exp/slices"

"github.com/ethereum-optimism/optimism/op-node/rollup"
"github.com/ethereum-optimism/optimism/op-service/eth"
Expand Down
2 changes: 1 addition & 1 deletion op-service/sources/batching/test/abi_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"slices"
"testing"

"github.com/ethereum-optimism/optimism/op-service/sources/batching/rpcblock"
Expand All @@ -13,7 +14,6 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"
)

type expectedCall struct {
Expand Down
2 changes: 1 addition & 1 deletion op-service/txmgr/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"math/big"
"slices"
"testing"
"time"

Expand All @@ -14,7 +15,6 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/stretchr/testify/require"
"golang.org/x/exp/slices"
)

type queueFunc func(id int, candidate TxCandidate, receiptCh chan TxReceipt[int], q *Queue[int]) bool
Expand Down

0 comments on commit ef86c58

Please sign in to comment.