switch from unmaintained golang/mock to go.uber.org/mock (#4050)

This commit is contained in:
Marten Seemann 2023-08-28 16:23:55 +07:00 committed by GitHub
parent 8f34488c76
commit 2797f85fc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 130 additions and 167 deletions

View file

@ -6,9 +6,9 @@ import (
"github.com/quic-go/quic-go"
mockquic "github.com/quic-go/quic-go/internal/mocks/quic"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"go.uber.org/mock/gomock"
)
var _ = Describe("Response Body", func() {

View file

@ -18,11 +18,11 @@ import (
"github.com/quic-go/quic-go/internal/utils"
"github.com/quic-go/quic-go/quicvarint"
"github.com/golang/mock/gomock"
"github.com/quic-go/qpack"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"go.uber.org/mock/gomock"
)
var _ = Describe("Client", func() {

View file

@ -6,10 +6,9 @@ import (
"testing"
"time"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"go.uber.org/mock/gomock"
)
func TestHttp3(t *testing.T) {

View file

@ -7,9 +7,9 @@ import (
"github.com/quic-go/quic-go"
mockquic "github.com/quic-go/quic-go/internal/mocks/quic"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"go.uber.org/mock/gomock"
)
func getDataFrame(data []byte) []byte {

View file

@ -9,8 +9,8 @@ import (
net "net"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
quic "github.com/quic-go/quic-go"
gomock "go.uber.org/mock/gomock"
)
// MockQUICEarlyListener is a mock of QUICEarlyListener interface.

View file

@ -8,7 +8,7 @@ import (
http "net/http"
reflect "reflect"
gomock "github.com/golang/mock/gomock"
gomock "go.uber.org/mock/gomock"
)
// MockRoundTripCloser is a mock of RoundTripCloser interface.

View file

@ -2,7 +2,7 @@
package http3
//go:generate sh -c "go run github.com/golang/mock/mockgen -build_flags=\"-tags=gomock\" -package http3 -destination mock_roundtripcloser_test.go github.com/quic-go/quic-go/http3 RoundTripCloser"
//go:generate sh -c "go run go.uber.org/mock/mockgen -build_flags=\"-tags=gomock\" -package http3 -destination mock_roundtripcloser_test.go github.com/quic-go/quic-go/http3 RoundTripCloser"
type RoundTripCloser = roundTripCloser
//go:generate sh -c "go run github.com/golang/mock/mockgen -package http3 -destination mock_quic_early_listener_test.go github.com/quic-go/quic-go/http3 QUICEarlyListener"
//go:generate sh -c "go run go.uber.org/mock/mockgen -package http3 -destination mock_quic_early_listener_test.go github.com/quic-go/quic-go/http3 QUICEarlyListener"

View file

@ -8,8 +8,8 @@ import (
mockquic "github.com/quic-go/quic-go/internal/mocks/quic"
"github.com/quic-go/quic-go/internal/utils"
"github.com/golang/mock/gomock"
"github.com/quic-go/qpack"
"go.uber.org/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

View file

@ -9,11 +9,11 @@ import (
mockquic "github.com/quic-go/quic-go/internal/mocks/quic"
"github.com/quic-go/quic-go/internal/utils"
"github.com/golang/mock/gomock"
"github.com/quic-go/qpack"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"go.uber.org/mock/gomock"
)
var _ = Describe("Response Writer", func() {

View file

@ -13,9 +13,9 @@ import (
"github.com/quic-go/quic-go"
"github.com/quic-go/quic-go/internal/qerr"
"github.com/golang/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"go.uber.org/mock/gomock"
)
type mockBody struct {

View file

@ -20,8 +20,8 @@ import (
"github.com/quic-go/quic-go/internal/utils"
"github.com/quic-go/quic-go/quicvarint"
"github.com/golang/mock/gomock"
"github.com/quic-go/qpack"
"go.uber.org/mock/gomock"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"