Skip to content

Commit

Permalink
go.mod: use go.etcd.io/etcd/v3 versioning
Browse files Browse the repository at this point in the history
This change makes the etcd package compatible with the existing Go
ecosystem for module versioning.

Used this tool to update package imports:
  https://github.com/KSubedi/gomove
  • Loading branch information
philips committed Apr 28, 2020
1 parent 8969a46 commit c95025b
Show file tree
Hide file tree
Showing 40 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package raft
import (
"errors"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

// Bootstrap initializes the RawNode for first use by appending configuration
Expand Down
6 changes: 3 additions & 3 deletions confchange/confchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"fmt"
"strings"

"go.etcd.io/etcd/raft/quorum"
pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
"go.etcd.io/etcd/v3/raft/quorum"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

// Changer facilitates configuration changes. It exposes methods to handle
Expand Down
4 changes: 2 additions & 2 deletions confchange/datadriven_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

func TestConfChangeDataDriven(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions confchange/quick_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"
"testing/quick"

pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

// TestConfChangeQuick uses quickcheck to verify that simple and joint config
Expand Down
4 changes: 2 additions & 2 deletions confchange/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
package confchange

import (
pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

// toConfChangeSingle translates a conf state into 1) a slice of operations creating
Expand Down
4 changes: 2 additions & 2 deletions confchange/restore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"
"testing/quick"

pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

type rndConfChange pb.ConfState
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package raft

import (
pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

func applyToStore(ents []pb.Entry) {}
Expand Down
2 changes: 1 addition & 1 deletion interaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/rafttest"
"go.etcd.io/etcd/v3/raft/rafttest"
)

func TestInteraction(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"log"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

type raftLog struct {
Expand Down
2 changes: 1 addition & 1 deletion log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"reflect"
"testing"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

func TestFindConflict(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion log_unstable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"reflect"
"testing"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

func TestUnstableMaybeFirstIndex(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion node.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"context"
"errors"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

type SnapshotStatus int
Expand Down
4 changes: 2 additions & 2 deletions node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"testing"
"time"

"go.etcd.io/etcd/pkg/testutil"
"go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/pkg/testutil"
"go.etcd.io/etcd/v3/raft/raftpb"
)

// readyWithTimeout selects from n.Ready() with a 1-second timeout. It
Expand Down
8 changes: 4 additions & 4 deletions raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import (
"sync"
"time"

"go.etcd.io/etcd/raft/confchange"
"go.etcd.io/etcd/raft/quorum"
pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
"go.etcd.io/etcd/v3/raft/confchange"
"go.etcd.io/etcd/v3/raft/quorum"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

// None is a placeholder node ID used when there is no leader.
Expand Down
2 changes: 1 addition & 1 deletion raft_flow_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package raft
import (
"testing"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

// TestMsgAppFlowControlFull ensures:
Expand Down
2 changes: 1 addition & 1 deletion raft_paper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"sort"
"testing"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

func TestFollowerUpdateTermFromMessage(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion raft_snap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package raft
import (
"testing"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"strings"
"testing"

pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

// nextEnts returns the appliable entries and updates the applied index
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"math"
"strings"

"go.etcd.io/etcd/raft"
pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

// InteractionOpts groups the options for an InteractionEnv.
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env_handler_add_nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft"
pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

func (env *InteractionEnv) handleAddNodes(t *testing.T, d datadriven.TestData) error {
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env_handler_deliver_msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft"
"go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft"
"go.etcd.io/etcd/v3/raft/raftpb"
)

func (env *InteractionEnv) handleDeliverMsgs(t *testing.T, d datadriven.TestData) error {
Expand Down
4 changes: 2 additions & 2 deletions rafttest/interaction_env_handler_process_ready.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft"
"go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft"
"go.etcd.io/etcd/v3/raft/raftpb"
)

func (env *InteractionEnv) handleProcessReady(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_propose_conf_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft/raftpb"
)

func (env *InteractionEnv) handleProposeConfChange(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_raft_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft"
"go.etcd.io/etcd/v3/raft"
)

func (env *InteractionEnv) handleRaftLog(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_stabilize.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft/raftpb"
)

func (env *InteractionEnv) handleStabilize(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_handler_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"

"github.com/cockroachdb/datadriven"
"go.etcd.io/etcd/raft/tracker"
"go.etcd.io/etcd/v3/raft/tracker"
)

func (env *InteractionEnv) handleStatus(t *testing.T, d datadriven.TestData) error {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/interaction_env_logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"strings"

"go.etcd.io/etcd/raft"
"go.etcd.io/etcd/v3/raft"
)

type logLevels [6]string
Expand Down
2 changes: 1 addition & 1 deletion rafttest/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"sync"
"time"

"go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft/raftpb"
)

// a network interface
Expand Down
2 changes: 1 addition & 1 deletion rafttest/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"
"time"

"go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft/raftpb"
)

func TestNetworkDrop(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions rafttest/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"sync"
"time"

"go.etcd.io/etcd/raft"
"go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft"
"go.etcd.io/etcd/v3/raft/raftpb"
)

type node struct {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/node_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"
"time"

"go.etcd.io/etcd/raft"
"go.etcd.io/etcd/v3/raft"
)

func BenchmarkProposal3Nodes(b *testing.B) {
Expand Down
2 changes: 1 addition & 1 deletion rafttest/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"testing"
"time"

"go.etcd.io/etcd/raft"
"go.etcd.io/etcd/v3/raft"
)

func TestBasicProgress(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions rawnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package raft
import (
"errors"

pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

// ErrStepLocalMsg is returned when try to step a local raft message
Expand Down
6 changes: 3 additions & 3 deletions rawnode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"reflect"
"testing"

"go.etcd.io/etcd/raft/quorum"
pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
"go.etcd.io/etcd/v3/raft/quorum"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

// rawNodeAdapter is essentially a lint that makes sure that RawNode implements
Expand Down
4 changes: 2 additions & 2 deletions status.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package raft
import (
"fmt"

pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/raft/tracker"
pb "go.etcd.io/etcd/v3/raft/raftpb"
"go.etcd.io/etcd/v3/raft/tracker"
)

// Status contains information about this Raft peer and its view of the system.
Expand Down
2 changes: 1 addition & 1 deletion storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"errors"
"sync"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

// ErrCompacted is returned by Storage.Entries/Compact when a requested
Expand Down
2 changes: 1 addition & 1 deletion storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"reflect"
"testing"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

func TestStorageTerm(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions tracker/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"sort"
"strings"

"go.etcd.io/etcd/raft/quorum"
pb "go.etcd.io/etcd/raft/raftpb"
"go.etcd.io/etcd/v3/raft/quorum"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

// Config reflects the configuration tracked in a ProgressTracker.
Expand Down
2 changes: 1 addition & 1 deletion util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"strings"

pb "go.etcd.io/etcd/raft/raftpb"
pb "go.etcd.io/etcd/v3/raft/raftpb"
)

func (st StateType) MarshalJSON() ([]byte, error) {
Expand Down
Loading

0 comments on commit c95025b

Please sign in to comment.