Migrate to Go modules
This commit is contained in:
committed by
Suhas Karanth
parent
af008c214b
commit
1163963381
@@ -393,7 +393,7 @@ func TestVendoredPackages(t *testing.T) {
|
||||
s := buf.String()
|
||||
// assertions of things that should be mentioned
|
||||
var strs = []string{
|
||||
`"github.com/matryer/somerepo"`,
|
||||
`"github.com/sudo-suhas/moq-test-pkgs/somerepo"`,
|
||||
}
|
||||
for _, str := range strs {
|
||||
if !strings.Contains(s, str) {
|
||||
@@ -404,7 +404,7 @@ func TestVendoredPackages(t *testing.T) {
|
||||
|
||||
func TestVendoredInterface(t *testing.T) {
|
||||
m, err := New(Config{
|
||||
SrcDir: "testpackages/vendoring/vendor/github.com/matryer/somerepo",
|
||||
SrcDir: "testpackages/vendoring/vendor/github.com/sudo-suhas/moq-test-pkgs/somerepo",
|
||||
PkgName: "someother",
|
||||
})
|
||||
if err != nil {
|
||||
@@ -418,14 +418,14 @@ func TestVendoredInterface(t *testing.T) {
|
||||
s := buf.String()
|
||||
// assertions of things that should be mentioned
|
||||
var strs = []string{
|
||||
`"github.com/matryer/somerepo"`,
|
||||
`"github.com/sudo-suhas/moq-test-pkgs/somerepo"`,
|
||||
}
|
||||
for _, str := range strs {
|
||||
if !strings.Contains(s, str) {
|
||||
t.Errorf("expected but missing: \"%s\"", str)
|
||||
}
|
||||
}
|
||||
incorrectImport := `"github.com/matryer/moq/pkg/moq/testpackages/vendoring/vendor/github.com/matryer/somerepo"`
|
||||
incorrectImport := `"github.com/matryer/moq/pkg/moq/testpackages/vendoring/vendor/github.com/sudo-suhas/moq-test-pkgs/somerepo"`
|
||||
if strings.Contains(s, incorrectImport) {
|
||||
t.Errorf("unexpected import: %s", incorrectImport)
|
||||
}
|
||||
@@ -444,7 +444,7 @@ func TestVendoredBuildConstraints(t *testing.T) {
|
||||
s := buf.String()
|
||||
// assertions of things that should be mentioned
|
||||
var strs = []string{
|
||||
`"github.com/matryer/buildconstraints"`,
|
||||
`"github.com/sudo-suhas/moq-test-pkgs/buildconstraints"`,
|
||||
}
|
||||
for _, str := range strs {
|
||||
if !strings.Contains(s, str) {
|
||||
|
5
pkg/moq/testpackages/buildconstraints/go.mod
Normal file
5
pkg/moq/testpackages/buildconstraints/go.mod
Normal file
@@ -0,0 +1,5 @@
|
||||
module github.com/matryer/moq/pkg/moq/testpackages/buildconstraints
|
||||
|
||||
go 1.14
|
||||
|
||||
require github.com/sudo-suhas/moq-test-pkgs/buildconstraints v0.0.0-20200816045313-d2f573eea6c7
|
3
pkg/moq/testpackages/buildconstraints/go.sum
Normal file
3
pkg/moq/testpackages/buildconstraints/go.sum
Normal file
@@ -0,0 +1,3 @@
|
||||
github.com/sudo-suhas/moq-test-pkgs v0.0.0-20200816045313-d2f573eea6c7 h1:Nrz0lKzL7rEBWiclll8DLmBAuPZxMdJTe3UHzPOUkgg=
|
||||
github.com/sudo-suhas/moq-test-pkgs/buildconstraints v0.0.0-20200816045313-d2f573eea6c7 h1:/GmPJhGa5xWMHHdGZ7K5MNM6prYeSnlSUeExdNg62bk=
|
||||
github.com/sudo-suhas/moq-test-pkgs/buildconstraints v0.0.0-20200816045313-d2f573eea6c7/go.mod h1:3SKj4JbVOiJQrGo/HyVTyp+jKwC8eIIDtOaK4L5RZNE=
|
@@ -1,9 +1,8 @@
|
||||
package user
|
||||
|
||||
import "github.com/matryer/buildconstraints"
|
||||
import "github.com/sudo-suhas/moq-test-pkgs/buildconstraints"
|
||||
|
||||
// Service does something good with computers.
|
||||
type Service interface {
|
||||
DoSomething(buildconstraints.SomeType) error
|
||||
}
|
||||
|
||||
|
3
pkg/moq/testpackages/buildconstraints/vendor/github.com/sudo-suhas/moq-test-pkgs/buildconstraints/go.mod
generated
vendored
Normal file
3
pkg/moq/testpackages/buildconstraints/vendor/github.com/sudo-suhas/moq-test-pkgs/buildconstraints/go.mod
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module github.com/sudo-suhas/moq-test-pkgs/buildconstraints
|
||||
|
||||
go 1.14
|
@@ -9,4 +9,3 @@ type SomeType struct {
|
||||
// Truth indicates whether true is true or not. Computers.
|
||||
Truth bool
|
||||
}
|
||||
|
@@ -3,4 +3,3 @@
|
||||
package buildconstraints
|
||||
|
||||
var someVariable = "Value 2"
|
||||
|
3
pkg/moq/testpackages/buildconstraints/vendor/modules.txt
vendored
Normal file
3
pkg/moq/testpackages/buildconstraints/vendor/modules.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# github.com/sudo-suhas/moq-test-pkgs/buildconstraints v0.0.0-20200816045313-d2f573eea6c7
|
||||
## explicit
|
||||
github.com/sudo-suhas/moq-test-pkgs/buildconstraints
|
5
pkg/moq/testpackages/go.mod
Normal file
5
pkg/moq/testpackages/go.mod
Normal file
@@ -0,0 +1,5 @@
|
||||
module github.com/matryer/moq/pkg/moq/testpackages
|
||||
|
||||
go 1.14
|
||||
|
||||
require github.com/sudo-suhas/moq-test-pkgs/somerepo v0.0.0-20200816045313-d2f573eea6c7
|
2
pkg/moq/testpackages/go.sum
Normal file
2
pkg/moq/testpackages/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/sudo-suhas/moq-test-pkgs/somerepo v0.0.0-20200816045313-d2f573eea6c7 h1:5TDSgxW5A9Homgu8Kh0iB1aeRCgM1y8pZaxAR0TjeQs=
|
||||
github.com/sudo-suhas/moq-test-pkgs/somerepo v0.0.0-20200816045313-d2f573eea6c7/go.mod h1:3CK3+2qBd+EkNJP+dgGjVYIbEwRQWVf6EgcmyIjTi2A=
|
@@ -1,6 +1,6 @@
|
||||
package user
|
||||
|
||||
import "github.com/matryer/somerepo"
|
||||
import "github.com/sudo-suhas/moq-test-pkgs/somerepo"
|
||||
|
||||
//go:generate moq -out user_moq_test.go . Service
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"github.com/matryer/somerepo"
|
||||
"github.com/sudo-suhas/moq-test-pkgs/somerepo"
|
||||
"sync"
|
||||
)
|
||||
|
||||
|
3
pkg/moq/testpackages/vendor/github.com/sudo-suhas/moq-test-pkgs/somerepo/go.mod
generated
vendored
Normal file
3
pkg/moq/testpackages/vendor/github.com/sudo-suhas/moq-test-pkgs/somerepo/go.mod
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module github.com/sudo-suhas/moq-test-pkgs/somerepo
|
||||
|
||||
go 1.14
|
3
pkg/moq/testpackages/vendor/modules.txt
vendored
Normal file
3
pkg/moq/testpackages/vendor/modules.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# github.com/sudo-suhas/moq-test-pkgs/somerepo v0.0.0-20200816045313-d2f573eea6c7
|
||||
## explicit
|
||||
github.com/sudo-suhas/moq-test-pkgs/somerepo
|
5
pkg/moq/testpackages/vendoring/go.mod
Normal file
5
pkg/moq/testpackages/vendoring/go.mod
Normal file
@@ -0,0 +1,5 @@
|
||||
module github.com/matryer/moq/pkg/moq/testpackages/vendoring
|
||||
|
||||
go 1.14
|
||||
|
||||
require github.com/sudo-suhas/moq-test-pkgs/somerepo v0.0.0-20200816045313-d2f573eea6c7
|
2
pkg/moq/testpackages/vendoring/go.sum
Normal file
2
pkg/moq/testpackages/vendoring/go.sum
Normal file
@@ -0,0 +1,2 @@
|
||||
github.com/sudo-suhas/moq-test-pkgs/somerepo v0.0.0-20200816045313-d2f573eea6c7 h1:5TDSgxW5A9Homgu8Kh0iB1aeRCgM1y8pZaxAR0TjeQs=
|
||||
github.com/sudo-suhas/moq-test-pkgs/somerepo v0.0.0-20200816045313-d2f573eea6c7/go.mod h1:3CK3+2qBd+EkNJP+dgGjVYIbEwRQWVf6EgcmyIjTi2A=
|
@@ -1,6 +1,6 @@
|
||||
package user
|
||||
|
||||
import "github.com/matryer/somerepo"
|
||||
import "github.com/sudo-suhas/moq-test-pkgs/somerepo"
|
||||
|
||||
// Service does something good with computers.
|
||||
type Service interface {
|
||||
|
13
pkg/moq/testpackages/vendoring/vendor/github.com/sudo-suhas/moq-test-pkgs/somerepo/code.go
generated
vendored
Normal file
13
pkg/moq/testpackages/vendoring/vendor/github.com/sudo-suhas/moq-test-pkgs/somerepo/code.go
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// Package somerepo is a vendored package to test how moq deals with
|
||||
// packages in the vendor package.
|
||||
package somerepo
|
||||
|
||||
// SomeType is just some old type.
|
||||
type SomeType struct {
|
||||
// Truth indicates whether true is true or not. Computers.
|
||||
Truth bool
|
||||
}
|
||||
|
||||
type SomeService interface {
|
||||
Get() SomeType
|
||||
}
|
3
pkg/moq/testpackages/vendoring/vendor/github.com/sudo-suhas/moq-test-pkgs/somerepo/go.mod
generated
vendored
Normal file
3
pkg/moq/testpackages/vendoring/vendor/github.com/sudo-suhas/moq-test-pkgs/somerepo/go.mod
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module github.com/sudo-suhas/moq-test-pkgs/somerepo
|
||||
|
||||
go 1.14
|
3
pkg/moq/testpackages/vendoring/vendor/modules.txt
vendored
Normal file
3
pkg/moq/testpackages/vendoring/vendor/modules.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# github.com/sudo-suhas/moq-test-pkgs/somerepo v0.0.0-20200816045313-d2f573eea6c7
|
||||
## explicit
|
||||
github.com/sudo-suhas/moq-test-pkgs/somerepo
|
4
pkg/vendor/github.com/matryer/somerepo/yep.go
generated
vendored
4
pkg/vendor/github.com/matryer/somerepo/yep.go
generated
vendored
@@ -1,4 +0,0 @@
|
||||
package somerepo
|
||||
|
||||
// SomeType is some type
|
||||
type SomeType string
|
Reference in New Issue
Block a user