Skip to content

Commit

Permalink
chore: add /v2 suffix to module import path
Browse files Browse the repository at this point in the history
Since #253 added a `go.mod` for
toxiproxy, the v2.x.x release from v2.1.5 can no longer be referred to
as an `+incompatible` module dependency and is required to have a `/v2`
suffix on the module path.

```
server response: not found: github.com/Shopify/toxiproxy@v2.1.5+incompatible:
  invalid version: +incompatible suffix not allowed:
    module contains a go.mod file, so semantic import versioning is required
```
(see [Go Modules have a v2+ Problem](https://donatstudios.com/Go-v2-Modules) for further discussion)

Fixes #310
  • Loading branch information
dnwe authored and miry committed Sep 14, 2021
1 parent dfab1f5 commit 9447d38
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"os"
"strings"

"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2/toxics"
"github.com/gorilla/mux"
"github.com/sirupsen/logrus"
)
Expand Down
4 changes: 2 additions & 2 deletions api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"
"time"

"github.com/Shopify/toxiproxy"
tclient "github.com/Shopify/toxiproxy/client"
"github.com/Shopify/toxiproxy/v2"
tclient "github.com/Shopify/toxiproxy/v2/client"
)

var testServer *toxiproxy.ApiServer
Expand Down
4 changes: 2 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strconv"
"strings"

toxiproxyServer "github.com/Shopify/toxiproxy"
toxiproxy "github.com/Shopify/toxiproxy/client"
toxiproxyServer "github.com/Shopify/toxiproxy/v2"
toxiproxy "github.com/Shopify/toxiproxy/v2/client"
"github.com/urfave/cli/v2"
terminal "golang.org/x/term"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/toxiproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"syscall"
"time"

"github.com/Shopify/toxiproxy"
"github.com/Shopify/toxiproxy/v2"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/Shopify/toxiproxy
module github.com/Shopify/toxiproxy/v2

go 1.17

Expand Down
4 changes: 2 additions & 2 deletions link.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package toxiproxy
import (
"io"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2/stream"
"github.com/Shopify/toxiproxy/v2/toxics"
"github.com/sirupsen/logrus"
)

Expand Down
6 changes: 3 additions & 3 deletions link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"testing"
"time"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/testhelper"
"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2/stream"
"github.com/Shopify/toxiproxy/v2/testhelper"
"github.com/Shopify/toxiproxy/v2/toxics"
)

func TestToxicsAreLoaded(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"sync"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/v2/stream"
"github.com/sirupsen/logrus"
tomb "gopkg.in/tomb.v1"
)
Expand Down
2 changes: 1 addition & 1 deletion proxy_collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net"
"testing"

"github.com/Shopify/toxiproxy"
"github.com/Shopify/toxiproxy/v2"
)

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

"github.com/Shopify/toxiproxy"
"github.com/Shopify/toxiproxy/v2"
"github.com/sirupsen/logrus"
tomb "gopkg.in/tomb.v1"
)
Expand Down
4 changes: 2 additions & 2 deletions toxic_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"
"sync"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2/stream"
"github.com/Shopify/toxiproxy/v2/toxics"
)

// ToxicCollection contains a list of toxics that are chained together. Each proxy
Expand Down
2 changes: 1 addition & 1 deletion toxics/bandwidth.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package toxics
import (
"time"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/v2/stream"
)

// The BandwidthToxic passes data through at a limited rate
Expand Down
2 changes: 1 addition & 1 deletion toxics/bandwidth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
"time"

"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2/toxics"
)

func TestBandwidthToxic(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions toxics/latency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"testing"
"time"

"github.com/Shopify/toxiproxy"
"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2"
"github.com/Shopify/toxiproxy/v2/toxics"
)

func AssertDeltaTime(t *testing.T, message string, actual, expected, delta time.Duration) {
Expand Down
2 changes: 1 addition & 1 deletion toxics/limit_data.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package toxics

import "github.com/Shopify/toxiproxy/stream"
import "github.com/Shopify/toxiproxy/v2/stream"

// LimitDataToxic has limit in bytes
type LimitDataToxic struct {
Expand Down
4 changes: 2 additions & 2 deletions toxics/limit_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"testing"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2/stream"
"github.com/Shopify/toxiproxy/v2/toxics"
)

func buffer(size int) []byte {
Expand Down
2 changes: 1 addition & 1 deletion toxics/slicer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math/rand"
"time"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/v2/stream"
)

// The SlicerToxic slices data into multiple smaller packets
Expand Down
4 changes: 2 additions & 2 deletions toxics/slicer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2/stream"
"github.com/Shopify/toxiproxy/v2/toxics"
)

func TestSlicerToxic(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions toxics/timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"testing"
"time"

"github.com/Shopify/toxiproxy"
"github.com/Shopify/toxiproxy/testhelper"
"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2"
"github.com/Shopify/toxiproxy/v2/testhelper"
"github.com/Shopify/toxiproxy/v2/toxics"
)

func WithEstablishedProxy(t *testing.T, f func(net.Conn, net.Conn, *toxiproxy.Proxy)) {
Expand Down
2 changes: 1 addition & 1 deletion toxics/toxic.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"sync"

"github.com/Shopify/toxiproxy/stream"
"github.com/Shopify/toxiproxy/v2/stream"
)

// A Toxic is something that can be attatched to a link to modify the way
Expand Down
4 changes: 2 additions & 2 deletions toxics/toxic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"testing"
"time"

"github.com/Shopify/toxiproxy"
"github.com/Shopify/toxiproxy/toxics"
"github.com/Shopify/toxiproxy/v2"
"github.com/Shopify/toxiproxy/v2/toxics"
"github.com/sirupsen/logrus"
tomb "gopkg.in/tomb.v1"
)
Expand Down

0 comments on commit 9447d38

Please sign in to comment.