Bump google.golang.org/api
This commit is contained in:
36
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/README.md
generated
vendored
Normal file
36
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/README.md
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
Embedded interfaces in `aux_files` generate `unknown embedded interface XXX` errors.
|
||||
See below for example of the problem:
|
||||
```
|
||||
// source
|
||||
import (
|
||||
alias "some.org/package/imported"
|
||||
)
|
||||
|
||||
type Source interface {
|
||||
alias.Foreign
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
// some.org/package/imported
|
||||
type Foreign interface {
|
||||
Embedded
|
||||
}
|
||||
|
||||
type Embedded interface {}
|
||||
```
|
||||
|
||||
Attempting to generate a mock will result in an `unknown embedded interface Embedded`.
|
||||
The issue is that the `fileParser` stores `auxInterfaces` underneath the package name
|
||||
explicitly specified in the `aux_files` flag.
|
||||
|
||||
In the `parseInterface` method, there is an incorrect assumption about an embedded interface
|
||||
always being in the source file.
|
||||
```
|
||||
case *ast.Ident:
|
||||
// Embedded interface in this package.
|
||||
ei := p.auxInterfaces[""][v.String()]
|
||||
if ei == nil {
|
||||
return nil, p.errorf(v.Pos(), "unknown embedded interface %s", v.String())
|
||||
}
|
||||
```
|
18
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/bugreport.go
generated
vendored
Normal file
18
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/bugreport.go
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
//go:generate mockgen -aux_files faux=faux/faux.go -destination bugreport_mock.go -package bugreport -source=bugreport.go Example
|
||||
|
||||
package bugreport
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/faux"
|
||||
)
|
||||
|
||||
// Source is an interface w/ an embedded foreign interface
|
||||
type Source interface {
|
||||
faux.Foreign
|
||||
}
|
||||
|
||||
func CallForeignMethod(s Source) {
|
||||
log.Println(s.Method())
|
||||
}
|
48
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/bugreport_mock.go
generated
vendored
Normal file
48
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/bugreport_mock.go
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: bugreport.go
|
||||
|
||||
// Package bugreport is a generated GoMock package.
|
||||
package bugreport
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
faux "github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/faux"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockSource is a mock of Source interface
|
||||
type MockSource struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockSourceMockRecorder
|
||||
}
|
||||
|
||||
// MockSourceMockRecorder is the mock recorder for MockSource
|
||||
type MockSourceMockRecorder struct {
|
||||
mock *MockSource
|
||||
}
|
||||
|
||||
// NewMockSource creates a new mock instance
|
||||
func NewMockSource(ctrl *gomock.Controller) *MockSource {
|
||||
mock := &MockSource{ctrl: ctrl}
|
||||
mock.recorder = &MockSourceMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockSource) EXPECT() *MockSourceMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Method mocks base method
|
||||
func (m *MockSource) Method() faux.Return {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Method")
|
||||
ret0, _ := ret[0].(faux.Return)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Method indicates an expected call of Method
|
||||
func (mr *MockSourceMockRecorder) Method() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Method", reflect.TypeOf((*MockSource)(nil).Method))
|
||||
}
|
18
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/bugreport_test.go
generated
vendored
Normal file
18
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/bugreport_test.go
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
package bugreport
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// TestValidInterface assesses whether or not the generated mock is valid
|
||||
func TestValidInterface(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
|
||||
s := NewMockSource(ctrl)
|
||||
s.EXPECT().Method().Return("")
|
||||
|
||||
CallForeignMethod(s)
|
||||
}
|
10
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/faux/faux.go
generated
vendored
Normal file
10
vendor/github.com/golang/mock/mockgen/internal/tests/aux_imports_embedded_interface/faux/faux.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
package faux
|
||||
|
||||
type Foreign interface {
|
||||
Method() Return
|
||||
Embedded
|
||||
}
|
||||
|
||||
type Embedded interface{}
|
||||
|
||||
type Return interface{}
|
22
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/README.md
generated
vendored
Normal file
22
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/README.md
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
# Tests for custom package names
|
||||
|
||||
This directory contains test for mockgen generating mocks when imported package
|
||||
name does not match import path suffix. For example, package with name "client"
|
||||
is located under import path "github.com/golang/mock/mockgen/internal/tests/custom_package_name/client/v1".
|
||||
|
||||
Prior to this patch:
|
||||
|
||||
$ go generate greeter/greeter.go
|
||||
2018/03/05 22:44:52 Loading input failed: greeter.go:17:11: failed parsing returns: greeter.go:17:14: unknown package "client"
|
||||
greeter/greeter.go:1: running "mockgen": exit status 1
|
||||
|
||||
This can be fixed by manually providing `-imports` flag, like `-imports client=github.com/golang/mock/mockgen/internal/tests/custom_package_name/client/v1`.
|
||||
But, mockgen should be able to automatically resolve package names in such situations.
|
||||
|
||||
With this patch applied:
|
||||
|
||||
$ go generate greeter/greeter.go
|
||||
$ echo $?
|
||||
0
|
||||
|
||||
Mockgen runs successfully, produced output is equal to [greeter_mock_test.go](greeter/greeter_mock_test.go) content.
|
13
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/client/v1/client.go
generated
vendored
Normal file
13
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/client/v1/client.go
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
package client
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Client struct{}
|
||||
|
||||
func (c *Client) Greet(in GreetInput) string {
|
||||
return fmt.Sprintf("Hello, %s!", in.Name)
|
||||
}
|
||||
|
||||
type GreetInput struct {
|
||||
Name string
|
||||
}
|
31
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/greeter/greeter.go
generated
vendored
Normal file
31
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/greeter/greeter.go
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
//go:generate mockgen -source greeter.go -destination greeter_mock_test.go -package greeter
|
||||
|
||||
package greeter
|
||||
|
||||
import (
|
||||
// stdlib import
|
||||
"fmt"
|
||||
|
||||
// non-matching import suffix and package name
|
||||
"github.com/golang/mock/mockgen/internal/tests/custom_package_name/client/v1"
|
||||
|
||||
// matching import suffix and package name
|
||||
"github.com/golang/mock/mockgen/internal/tests/custom_package_name/validator"
|
||||
)
|
||||
|
||||
type InputMaker interface {
|
||||
MakeInput() client.GreetInput
|
||||
}
|
||||
|
||||
type Greeter struct {
|
||||
InputMaker InputMaker
|
||||
Client *client.Client
|
||||
}
|
||||
|
||||
func (g *Greeter) Greet() (string, error) {
|
||||
in := g.InputMaker.MakeInput()
|
||||
if err := validator.Validate(in.Name); err != nil {
|
||||
return "", fmt.Errorf("validation failed: %v", err)
|
||||
}
|
||||
return g.Client.Greet(in), nil
|
||||
}
|
48
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/greeter/greeter_mock_test.go
generated
vendored
Normal file
48
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/greeter/greeter_mock_test.go
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: greeter.go
|
||||
|
||||
// Package greeter is a generated GoMock package.
|
||||
package greeter
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
v1 "github.com/golang/mock/mockgen/internal/tests/custom_package_name/client/v1"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockInputMaker is a mock of InputMaker interface
|
||||
type MockInputMaker struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockInputMakerMockRecorder
|
||||
}
|
||||
|
||||
// MockInputMakerMockRecorder is the mock recorder for MockInputMaker
|
||||
type MockInputMakerMockRecorder struct {
|
||||
mock *MockInputMaker
|
||||
}
|
||||
|
||||
// NewMockInputMaker creates a new mock instance
|
||||
func NewMockInputMaker(ctrl *gomock.Controller) *MockInputMaker {
|
||||
mock := &MockInputMaker{ctrl: ctrl}
|
||||
mock.recorder = &MockInputMakerMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockInputMaker) EXPECT() *MockInputMakerMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// MakeInput mocks base method
|
||||
func (m *MockInputMaker) MakeInput() v1.GreetInput {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "MakeInput")
|
||||
ret0, _ := ret[0].(v1.GreetInput)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// MakeInput indicates an expected call of MakeInput
|
||||
func (mr *MockInputMakerMockRecorder) MakeInput() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MakeInput", reflect.TypeOf((*MockInputMaker)(nil).MakeInput))
|
||||
}
|
37
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/greeter/greeter_test.go
generated
vendored
Normal file
37
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/greeter/greeter_test.go
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package greeter
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/golang/mock/mockgen/internal/tests/custom_package_name/client/v1"
|
||||
)
|
||||
|
||||
func TestGreeter_Greet(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
|
||||
input := client.GreetInput{
|
||||
Name: "Foo",
|
||||
}
|
||||
|
||||
inputMaker := NewMockInputMaker(ctrl)
|
||||
inputMaker.EXPECT().
|
||||
MakeInput().
|
||||
Return(input)
|
||||
|
||||
g := &Greeter{
|
||||
InputMaker: inputMaker,
|
||||
Client: &client.Client{},
|
||||
}
|
||||
|
||||
greeting, err := g.Greet()
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
expected := "Hello, Foo!"
|
||||
if greeting != expected {
|
||||
t.Fatalf("Expected greeting to be %v but got %v", expected, greeting)
|
||||
}
|
||||
}
|
5
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/validator/validate.go
generated
vendored
Normal file
5
vendor/github.com/golang/mock/mockgen/internal/tests/custom_package_name/validator/validate.go
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
package validator
|
||||
|
||||
func Validate(s string) error {
|
||||
return nil
|
||||
}
|
14
vendor/github.com/golang/mock/mockgen/internal/tests/dot_imports/input.go
generated
vendored
Normal file
14
vendor/github.com/golang/mock/mockgen/internal/tests/dot_imports/input.go
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
//go:generate mockgen -package dot_imports -destination mock.go -source input.go
|
||||
package dot_imports
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
. "context"
|
||||
. "net/http"
|
||||
)
|
||||
|
||||
type WithDotImports interface {
|
||||
Method1() Request
|
||||
Method2() *bytes.Buffer
|
||||
Method3() Context
|
||||
}
|
78
vendor/github.com/golang/mock/mockgen/internal/tests/dot_imports/mock.go
generated
vendored
Normal file
78
vendor/github.com/golang/mock/mockgen/internal/tests/dot_imports/mock.go
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: input.go
|
||||
|
||||
// Package dot_imports is a generated GoMock package.
|
||||
package dot_imports
|
||||
|
||||
import (
|
||||
bytes "bytes"
|
||||
. "context"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
. "net/http"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockWithDotImports is a mock of WithDotImports interface
|
||||
type MockWithDotImports struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockWithDotImportsMockRecorder
|
||||
}
|
||||
|
||||
// MockWithDotImportsMockRecorder is the mock recorder for MockWithDotImports
|
||||
type MockWithDotImportsMockRecorder struct {
|
||||
mock *MockWithDotImports
|
||||
}
|
||||
|
||||
// NewMockWithDotImports creates a new mock instance
|
||||
func NewMockWithDotImports(ctrl *gomock.Controller) *MockWithDotImports {
|
||||
mock := &MockWithDotImports{ctrl: ctrl}
|
||||
mock.recorder = &MockWithDotImportsMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockWithDotImports) EXPECT() *MockWithDotImportsMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Method1 mocks base method
|
||||
func (m *MockWithDotImports) Method1() Request {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Method1")
|
||||
ret0, _ := ret[0].(Request)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Method1 indicates an expected call of Method1
|
||||
func (mr *MockWithDotImportsMockRecorder) Method1() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Method1", reflect.TypeOf((*MockWithDotImports)(nil).Method1))
|
||||
}
|
||||
|
||||
// Method2 mocks base method
|
||||
func (m *MockWithDotImports) Method2() *bytes.Buffer {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Method2")
|
||||
ret0, _ := ret[0].(*bytes.Buffer)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Method2 indicates an expected call of Method2
|
||||
func (mr *MockWithDotImportsMockRecorder) Method2() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Method2", reflect.TypeOf((*MockWithDotImports)(nil).Method2))
|
||||
}
|
||||
|
||||
// Method3 mocks base method
|
||||
func (m *MockWithDotImports) Method3() Context {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Method3")
|
||||
ret0, _ := ret[0].(Context)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Method3 indicates an expected call of Method3
|
||||
func (mr *MockWithDotImportsMockRecorder) Method3() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Method3", reflect.TypeOf((*MockWithDotImports)(nil).Method3))
|
||||
}
|
4
vendor/github.com/golang/mock/mockgen/internal/tests/empty_interface/input.go
generated
vendored
Normal file
4
vendor/github.com/golang/mock/mockgen/internal/tests/empty_interface/input.go
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
//go:generate mockgen -package empty_interface -destination mock.go -source input.go
|
||||
package empty_interface
|
||||
|
||||
type Empty interface{}
|
32
vendor/github.com/golang/mock/mockgen/internal/tests/empty_interface/mock.go
generated
vendored
Normal file
32
vendor/github.com/golang/mock/mockgen/internal/tests/empty_interface/mock.go
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: input.go
|
||||
|
||||
// Package empty_interface is a generated GoMock package.
|
||||
package empty_interface
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockEmpty is a mock of Empty interface
|
||||
type MockEmpty struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockEmptyMockRecorder
|
||||
}
|
||||
|
||||
// MockEmptyMockRecorder is the mock recorder for MockEmpty
|
||||
type MockEmptyMockRecorder struct {
|
||||
mock *MockEmpty
|
||||
}
|
||||
|
||||
// NewMockEmpty creates a new mock instance
|
||||
func NewMockEmpty(ctrl *gomock.Controller) *MockEmpty {
|
||||
mock := &MockEmpty{ctrl: ctrl}
|
||||
mock.recorder = &MockEmptyMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockEmpty) EXPECT() *MockEmptyMockRecorder {
|
||||
return m.recorder
|
||||
}
|
26
vendor/github.com/golang/mock/mockgen/internal/tests/generated_identifier_conflict/README.md
generated
vendored
Normal file
26
vendor/github.com/golang/mock/mockgen/internal/tests/generated_identifier_conflict/README.md
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
The generated mock methods use some hardcoded variable/receiver names that can
|
||||
have conflicts with the argument names that are defined by the code for which
|
||||
the mock is generated when using the source generation method.
|
||||
|
||||
Example:
|
||||
|
||||
```go
|
||||
type Example interface {
|
||||
Method(_m, _mr, m, mr int)
|
||||
}
|
||||
```
|
||||
|
||||
```go
|
||||
// Method mocks base method
|
||||
func (_m *MockExample) Method(_m int, _mr int, m int, mr int) {
|
||||
_m.ctrl.Call(_m, "Method", _m, _mr, m, mr)
|
||||
}
|
||||
```
|
||||
|
||||
In the above example one of the interface method parameters is called `_m`
|
||||
but unfortunately the generated receiver name is also called `_m` so the
|
||||
mock code won't compile.
|
||||
|
||||
The generator has to make sure that generated identifiers (e.g.: the receiver
|
||||
names) are always different from the arg names that might come from external
|
||||
sources.
|
16
vendor/github.com/golang/mock/mockgen/internal/tests/generated_identifier_conflict/bugreport.go
generated
vendored
Normal file
16
vendor/github.com/golang/mock/mockgen/internal/tests/generated_identifier_conflict/bugreport.go
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
//go:generate mockgen -destination bugreport_mock.go -package bugreport -source=bugreport.go
|
||||
|
||||
package bugreport
|
||||
|
||||
type Example interface {
|
||||
// _m and _mr were used by the buggy code: the '_' prefix was there hoping
|
||||
// that no one will use method argument names starting with '_' reducing
|
||||
// the chance of collision with generated identifiers.
|
||||
// m and mr are used by the bugfixed new code, the '_' prefix has been
|
||||
// removed because the new code generator changes the names of the
|
||||
// generated identifiers in case they would collide with identifiers
|
||||
// coming from argument names.
|
||||
Method(_m, _mr, m, mr int)
|
||||
|
||||
VarargMethod(_s, _x, a, ret int, varargs ...int)
|
||||
}
|
62
vendor/github.com/golang/mock/mockgen/internal/tests/generated_identifier_conflict/bugreport_mock.go
generated
vendored
Normal file
62
vendor/github.com/golang/mock/mockgen/internal/tests/generated_identifier_conflict/bugreport_mock.go
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: bugreport.go
|
||||
|
||||
// Package bugreport is a generated GoMock package.
|
||||
package bugreport
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockExample is a mock of Example interface
|
||||
type MockExample struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockExampleMockRecorder
|
||||
}
|
||||
|
||||
// MockExampleMockRecorder is the mock recorder for MockExample
|
||||
type MockExampleMockRecorder struct {
|
||||
mock *MockExample
|
||||
}
|
||||
|
||||
// NewMockExample creates a new mock instance
|
||||
func NewMockExample(ctrl *gomock.Controller) *MockExample {
|
||||
mock := &MockExample{ctrl: ctrl}
|
||||
mock.recorder = &MockExampleMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockExample) EXPECT() *MockExampleMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Method mocks base method
|
||||
func (m_2 *MockExample) Method(_m, _mr, m, mr int) {
|
||||
m_2.ctrl.T.Helper()
|
||||
m_2.ctrl.Call(m_2, "Method", _m, _mr, m, mr)
|
||||
}
|
||||
|
||||
// Method indicates an expected call of Method
|
||||
func (mr_2 *MockExampleMockRecorder) Method(_m, _mr, m, mr interface{}) *gomock.Call {
|
||||
mr_2.mock.ctrl.T.Helper()
|
||||
return mr_2.mock.ctrl.RecordCallWithMethodType(mr_2.mock, "Method", reflect.TypeOf((*MockExample)(nil).Method), _m, _mr, m, mr)
|
||||
}
|
||||
|
||||
// VarargMethod mocks base method
|
||||
func (m *MockExample) VarargMethod(_s, _x, a, ret int, varargs ...int) {
|
||||
m.ctrl.T.Helper()
|
||||
varargs_2 := []interface{}{_s, _x, a, ret}
|
||||
for _, a_2 := range varargs {
|
||||
varargs_2 = append(varargs_2, a_2)
|
||||
}
|
||||
m.ctrl.Call(m, "VarargMethod", varargs_2...)
|
||||
}
|
||||
|
||||
// VarargMethod indicates an expected call of VarargMethod
|
||||
func (mr *MockExampleMockRecorder) VarargMethod(_s, _x, a, ret interface{}, varargs ...interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
varargs_2 := append([]interface{}{_s, _x, a, ret}, varargs...)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VarargMethod", reflect.TypeOf((*MockExample)(nil).VarargMethod), varargs_2...)
|
||||
}
|
26
vendor/github.com/golang/mock/mockgen/internal/tests/generated_identifier_conflict/bugreport_test.go
generated
vendored
Normal file
26
vendor/github.com/golang/mock/mockgen/internal/tests/generated_identifier_conflict/bugreport_test.go
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package bugreport
|
||||
|
||||
import (
|
||||
"github.com/golang/mock/gomock"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestExample_Method(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
m := NewMockExample(ctrl)
|
||||
m.EXPECT().Method(1, 2, 3, 4)
|
||||
|
||||
m.Method(1, 2, 3, 4)
|
||||
|
||||
ctrl.Finish()
|
||||
}
|
||||
|
||||
func TestExample_VarargMethod(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
m := NewMockExample(ctrl)
|
||||
m.EXPECT().VarargMethod(1, 2, 3, 4, 6, 7)
|
||||
|
||||
m.VarargMethod(1, 2, 3, 4, 6, 7)
|
||||
|
||||
ctrl.Finish()
|
||||
}
|
3
vendor/github.com/golang/mock/mockgen/internal/tests/import_source/Readme.md
generated
vendored
Normal file
3
vendor/github.com/golang/mock/mockgen/internal/tests/import_source/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Test the case where the generated code uses a type defined in the source package (in source mode). There are two test cases:
|
||||
- the output is in a new package
|
||||
- the output is in the same package as the input
|
9
vendor/github.com/golang/mock/mockgen/internal/tests/import_source/definition/source.go
generated
vendored
Normal file
9
vendor/github.com/golang/mock/mockgen/internal/tests/import_source/definition/source.go
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
//go:generate mockgen -destination ../source_mock.go -source=source.go
|
||||
//go:generate mockgen -package source -destination source_mock.go -source=source.go
|
||||
package source
|
||||
|
||||
type X struct{}
|
||||
|
||||
type S interface {
|
||||
F(X)
|
||||
}
|
45
vendor/github.com/golang/mock/mockgen/internal/tests/import_source/definition/source_mock.go
generated
vendored
Normal file
45
vendor/github.com/golang/mock/mockgen/internal/tests/import_source/definition/source_mock.go
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: source.go
|
||||
|
||||
// Package source is a generated GoMock package.
|
||||
package source
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockS is a mock of S interface
|
||||
type MockS struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockSMockRecorder
|
||||
}
|
||||
|
||||
// MockSMockRecorder is the mock recorder for MockS
|
||||
type MockSMockRecorder struct {
|
||||
mock *MockS
|
||||
}
|
||||
|
||||
// NewMockS creates a new mock instance
|
||||
func NewMockS(ctrl *gomock.Controller) *MockS {
|
||||
mock := &MockS{ctrl: ctrl}
|
||||
mock.recorder = &MockSMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockS) EXPECT() *MockSMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// F mocks base method
|
||||
func (m *MockS) F(arg0 X) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "F", arg0)
|
||||
}
|
||||
|
||||
// F indicates an expected call of F
|
||||
func (mr *MockSMockRecorder) F(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "F", reflect.TypeOf((*MockS)(nil).F), arg0)
|
||||
}
|
46
vendor/github.com/golang/mock/mockgen/internal/tests/import_source/source_mock.go
generated
vendored
Normal file
46
vendor/github.com/golang/mock/mockgen/internal/tests/import_source/source_mock.go
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: source.go
|
||||
|
||||
// Package mock_source is a generated GoMock package.
|
||||
package mock_source
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
definition "github.com/golang/mock/mockgen/internal/tests/import_source/definition"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockS is a mock of S interface
|
||||
type MockS struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockSMockRecorder
|
||||
}
|
||||
|
||||
// MockSMockRecorder is the mock recorder for MockS
|
||||
type MockSMockRecorder struct {
|
||||
mock *MockS
|
||||
}
|
||||
|
||||
// NewMockS creates a new mock instance
|
||||
func NewMockS(ctrl *gomock.Controller) *MockS {
|
||||
mock := &MockS{ctrl: ctrl}
|
||||
mock.recorder = &MockSMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockS) EXPECT() *MockSMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// F mocks base method
|
||||
func (m *MockS) F(arg0 definition.X) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "F", arg0)
|
||||
}
|
||||
|
||||
// F indicates an expected call of F
|
||||
func (mr *MockSMockRecorder) F(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "F", reflect.TypeOf((*MockS)(nil).F), arg0)
|
||||
}
|
3
vendor/github.com/golang/mock/mockgen/internal/tests/internal_pkg/generate.go
generated
vendored
Normal file
3
vendor/github.com/golang/mock/mockgen/internal/tests/internal_pkg/generate.go
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
//go:generate mockgen -destination subdir/internal/pkg/reflect_output/mock.go github.com/golang/mock/mockgen/internal/tests/internal_pkg/subdir/internal/pkg Intf
|
||||
//go:generate mockgen -source subdir/internal/pkg/input.go -destination subdir/internal/pkg/source_output/mock.go
|
||||
package test
|
16
vendor/github.com/golang/mock/mockgen/internal/tests/mock_in_test_package/README.md
generated
vendored
Normal file
16
vendor/github.com/golang/mock/mockgen/internal/tests/mock_in_test_package/README.md
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
Test the case where the package has the `_test` suffix.
|
||||
|
||||
Prior to patch:
|
||||
|
||||
$ go generate
|
||||
$ go test
|
||||
# github.com/golang/mock/mockgen/internal/tests/mock_in_test_package_test [github.com/golang/mock/mockgen/internal/tests/mock_in_test_package.test]
|
||||
./mock_test.go:36:44: undefined: User
|
||||
./mock_test.go:38:21: undefined: User
|
||||
FAIL github.com/golang/mock/mockgen/internal/tests/mock_in_test_package [build failed]
|
||||
|
||||
With this patch applied:
|
||||
|
||||
$ go generate
|
||||
$ go test
|
||||
ok github.com/golang/mock/mockgen/internal/tests/mock_in_test_package 0.031s
|
60
vendor/github.com/golang/mock/mockgen/internal/tests/mock_in_test_package/mock_test.go
generated
vendored
Normal file
60
vendor/github.com/golang/mock/mockgen/internal/tests/mock_in_test_package/mock_test.go
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: user.go
|
||||
|
||||
// Package users_test is a generated GoMock package.
|
||||
package users_test
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
mock_in_test_package "github.com/golang/mock/mockgen/internal/tests/mock_in_test_package"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockFinder is a mock of Finder interface
|
||||
type MockFinder struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockFinderMockRecorder
|
||||
}
|
||||
|
||||
// MockFinderMockRecorder is the mock recorder for MockFinder
|
||||
type MockFinderMockRecorder struct {
|
||||
mock *MockFinder
|
||||
}
|
||||
|
||||
// NewMockFinder creates a new mock instance
|
||||
func NewMockFinder(ctrl *gomock.Controller) *MockFinder {
|
||||
mock := &MockFinder{ctrl: ctrl}
|
||||
mock.recorder = &MockFinderMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockFinder) EXPECT() *MockFinderMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// FindUser mocks base method
|
||||
func (m *MockFinder) FindUser(name string) mock_in_test_package.User {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindUser", name)
|
||||
ret0, _ := ret[0].(mock_in_test_package.User)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// FindUser indicates an expected call of FindUser
|
||||
func (mr *MockFinderMockRecorder) FindUser(name interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindUser", reflect.TypeOf((*MockFinder)(nil).FindUser), name)
|
||||
}
|
||||
|
||||
// Add mocks base method
|
||||
func (m *MockFinder) Add(u mock_in_test_package.User) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "Add", u)
|
||||
}
|
||||
|
||||
// Add indicates an expected call of Add
|
||||
func (mr *MockFinderMockRecorder) Add(u interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockFinder)(nil).Add), u)
|
||||
}
|
12
vendor/github.com/golang/mock/mockgen/internal/tests/mock_in_test_package/user.go
generated
vendored
Normal file
12
vendor/github.com/golang/mock/mockgen/internal/tests/mock_in_test_package/user.go
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package users
|
||||
|
||||
//go:generate mockgen --source=user.go --destination=mock_test.go --package=users_test
|
||||
|
||||
type User struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type Finder interface {
|
||||
FindUser(name string) User
|
||||
Add(u User)
|
||||
}
|
1
vendor/github.com/golang/mock/mockgen/internal/tests/test_package/foo.go
generated
vendored
Normal file
1
vendor/github.com/golang/mock/mockgen/internal/tests/test_package/foo.go
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
package users
|
59
vendor/github.com/golang/mock/mockgen/internal/tests/test_package/mock_test.go
generated
vendored
Normal file
59
vendor/github.com/golang/mock/mockgen/internal/tests/test_package/mock_test.go
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: user_test.go
|
||||
|
||||
// Package users_test is a generated GoMock package.
|
||||
package users_test
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockFinder is a mock of Finder interface
|
||||
type MockFinder struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockFinderMockRecorder
|
||||
}
|
||||
|
||||
// MockFinderMockRecorder is the mock recorder for MockFinder
|
||||
type MockFinderMockRecorder struct {
|
||||
mock *MockFinder
|
||||
}
|
||||
|
||||
// NewMockFinder creates a new mock instance
|
||||
func NewMockFinder(ctrl *gomock.Controller) *MockFinder {
|
||||
mock := &MockFinder{ctrl: ctrl}
|
||||
mock.recorder = &MockFinderMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockFinder) EXPECT() *MockFinderMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// FindUser mocks base method
|
||||
func (m *MockFinder) FindUser(name string) User {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "FindUser", name)
|
||||
ret0, _ := ret[0].(User)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// FindUser indicates an expected call of FindUser
|
||||
func (mr *MockFinderMockRecorder) FindUser(name interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindUser", reflect.TypeOf((*MockFinder)(nil).FindUser), name)
|
||||
}
|
||||
|
||||
// Add mocks base method
|
||||
func (m *MockFinder) Add(u User) {
|
||||
m.ctrl.T.Helper()
|
||||
m.ctrl.Call(m, "Add", u)
|
||||
}
|
||||
|
||||
// Add indicates an expected call of Add
|
||||
func (mr *MockFinderMockRecorder) Add(u interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockFinder)(nil).Add), u)
|
||||
}
|
12
vendor/github.com/golang/mock/mockgen/internal/tests/test_package/user_test.go
generated
vendored
Normal file
12
vendor/github.com/golang/mock/mockgen/internal/tests/test_package/user_test.go
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
package users_test
|
||||
|
||||
//go:generate mockgen --source=user_test.go --destination=mock_test.go --package=users_test
|
||||
|
||||
type User struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type Finder interface {
|
||||
FindUser(name string) User
|
||||
Add(u User)
|
||||
}
|
1
vendor/github.com/golang/mock/mockgen/internal/tests/unexported_method/README.md
generated
vendored
Normal file
1
vendor/github.com/golang/mock/mockgen/internal/tests/unexported_method/README.md
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
From #52, this tests an unexported method in the mocked interface.
|
15
vendor/github.com/golang/mock/mockgen/internal/tests/unexported_method/bugreport.go
generated
vendored
Normal file
15
vendor/github.com/golang/mock/mockgen/internal/tests/unexported_method/bugreport.go
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
//go:generate mockgen -destination bugreport_mock.go -package bugreport -source=bugreport.go Example
|
||||
|
||||
package bugreport
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Example is an interface with a non exported method
|
||||
type Example interface {
|
||||
someMethod(string) string
|
||||
}
|
||||
|
||||
// CallExample is a simple function that uses the interface
|
||||
func CallExample(e Example) {
|
||||
fmt.Println(e.someMethod("test"))
|
||||
}
|
47
vendor/github.com/golang/mock/mockgen/internal/tests/unexported_method/bugreport_mock.go
generated
vendored
Normal file
47
vendor/github.com/golang/mock/mockgen/internal/tests/unexported_method/bugreport_mock.go
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: bugreport.go
|
||||
|
||||
// Package bugreport is a generated GoMock package.
|
||||
package bugreport
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockExample is a mock of Example interface
|
||||
type MockExample struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockExampleMockRecorder
|
||||
}
|
||||
|
||||
// MockExampleMockRecorder is the mock recorder for MockExample
|
||||
type MockExampleMockRecorder struct {
|
||||
mock *MockExample
|
||||
}
|
||||
|
||||
// NewMockExample creates a new mock instance
|
||||
func NewMockExample(ctrl *gomock.Controller) *MockExample {
|
||||
mock := &MockExample{ctrl: ctrl}
|
||||
mock.recorder = &MockExampleMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockExample) EXPECT() *MockExampleMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// someMethod mocks base method
|
||||
func (m *MockExample) someMethod(arg0 string) string {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "someMethod", arg0)
|
||||
ret0, _ := ret[0].(string)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// someMethod indicates an expected call of someMethod
|
||||
func (mr *MockExampleMockRecorder) someMethod(arg0 interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "someMethod", reflect.TypeOf((*MockExample)(nil).someMethod), arg0)
|
||||
}
|
17
vendor/github.com/golang/mock/mockgen/internal/tests/unexported_method/bugreport_test.go
generated
vendored
Normal file
17
vendor/github.com/golang/mock/mockgen/internal/tests/unexported_method/bugreport_test.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package bugreport
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
func TestCallExample(t *testing.T) {
|
||||
ctrl := gomock.NewController(t)
|
||||
defer ctrl.Finish()
|
||||
|
||||
e := NewMockExample(ctrl)
|
||||
e.EXPECT().someMethod(gomock.Any()).Return("it works!")
|
||||
|
||||
CallExample(e)
|
||||
}
|
2
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/README.md
generated
vendored
Normal file
2
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/README.md
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
Test for [Issue#4](https://github.com/golang/mock/issues/4).
|
||||
Also see discussion on [#28](https://github.com/golang/mock/pull/28).
|
4
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/doc.go
generated
vendored
Normal file
4
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/doc.go
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
package vendor_dep
|
||||
|
||||
//go:generate mockgen -package vendor_dep -destination mock.go github.com/golang/mock/mockgen/internal/tests/vendor_dep VendorsDep
|
||||
//go:generate mockgen -destination source_mock_package/mock.go -source=vendor_dep.go
|
48
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/mock.go
generated
vendored
Normal file
48
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/mock.go
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/golang/mock/mockgen/internal/tests/vendor_dep (interfaces: VendorsDep)
|
||||
|
||||
// Package vendor_dep is a generated GoMock package.
|
||||
package vendor_dep
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
present "golang.org/x/tools/present"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockVendorsDep is a mock of VendorsDep interface
|
||||
type MockVendorsDep struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockVendorsDepMockRecorder
|
||||
}
|
||||
|
||||
// MockVendorsDepMockRecorder is the mock recorder for MockVendorsDep
|
||||
type MockVendorsDepMockRecorder struct {
|
||||
mock *MockVendorsDep
|
||||
}
|
||||
|
||||
// NewMockVendorsDep creates a new mock instance
|
||||
func NewMockVendorsDep(ctrl *gomock.Controller) *MockVendorsDep {
|
||||
mock := &MockVendorsDep{ctrl: ctrl}
|
||||
mock.recorder = &MockVendorsDepMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockVendorsDep) EXPECT() *MockVendorsDepMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Foo mocks base method
|
||||
func (m *MockVendorsDep) Foo() present.Elem {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Foo")
|
||||
ret0, _ := ret[0].(present.Elem)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Foo indicates an expected call of Foo
|
||||
func (mr *MockVendorsDepMockRecorder) Foo() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Foo", reflect.TypeOf((*MockVendorsDep)(nil).Foo))
|
||||
}
|
48
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/source_mock_package/mock.go
generated
vendored
Normal file
48
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/source_mock_package/mock.go
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: vendor_dep.go
|
||||
|
||||
// Package mock_vendor_dep is a generated GoMock package.
|
||||
package mock_vendor_dep
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
present "golang.org/x/tools/present"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockVendorsDep is a mock of VendorsDep interface
|
||||
type MockVendorsDep struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockVendorsDepMockRecorder
|
||||
}
|
||||
|
||||
// MockVendorsDepMockRecorder is the mock recorder for MockVendorsDep
|
||||
type MockVendorsDepMockRecorder struct {
|
||||
mock *MockVendorsDep
|
||||
}
|
||||
|
||||
// NewMockVendorsDep creates a new mock instance
|
||||
func NewMockVendorsDep(ctrl *gomock.Controller) *MockVendorsDep {
|
||||
mock := &MockVendorsDep{ctrl: ctrl}
|
||||
mock.recorder = &MockVendorsDepMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockVendorsDep) EXPECT() *MockVendorsDepMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// Foo mocks base method
|
||||
func (m *MockVendorsDep) Foo() present.Elem {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "Foo")
|
||||
ret0, _ := ret[0].(present.Elem)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// Foo indicates an expected call of Foo
|
||||
func (mr *MockVendorsDepMockRecorder) Foo() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Foo", reflect.TypeOf((*MockVendorsDep)(nil).Foo))
|
||||
}
|
7
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/vendor_dep.go
generated
vendored
Normal file
7
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_dep/vendor_dep.go
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
package vendor_dep
|
||||
|
||||
import "golang.org/x/tools/present"
|
||||
|
||||
type VendorsDep interface {
|
||||
Foo() present.Elem
|
||||
}
|
1
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_pkg/README.md
generated
vendored
Normal file
1
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_pkg/README.md
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Test for [Issue#4](https://github.com/golang/mock/issues/4).
|
3
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_pkg/doc.go
generated
vendored
Normal file
3
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_pkg/doc.go
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
package vendor_pkg
|
||||
|
||||
//go:generate mockgen -destination mock.go -package vendor_pkg golang.org/x/tools/present Elem
|
47
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_pkg/mock.go
generated
vendored
Normal file
47
vendor/github.com/golang/mock/mockgen/internal/tests/vendor_pkg/mock.go
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: golang.org/x/tools/present (interfaces: Elem)
|
||||
|
||||
// Package vendor_pkg is a generated GoMock package.
|
||||
package vendor_pkg
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockElem is a mock of Elem interface
|
||||
type MockElem struct {
|
||||
ctrl *gomock.Controller
|
||||
recorder *MockElemMockRecorder
|
||||
}
|
||||
|
||||
// MockElemMockRecorder is the mock recorder for MockElem
|
||||
type MockElemMockRecorder struct {
|
||||
mock *MockElem
|
||||
}
|
||||
|
||||
// NewMockElem creates a new mock instance
|
||||
func NewMockElem(ctrl *gomock.Controller) *MockElem {
|
||||
mock := &MockElem{ctrl: ctrl}
|
||||
mock.recorder = &MockElemMockRecorder{mock}
|
||||
return mock
|
||||
}
|
||||
|
||||
// EXPECT returns an object that allows the caller to indicate expected use
|
||||
func (m *MockElem) EXPECT() *MockElemMockRecorder {
|
||||
return m.recorder
|
||||
}
|
||||
|
||||
// TemplateName mocks base method
|
||||
func (m *MockElem) TemplateName() string {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "TemplateName")
|
||||
ret0, _ := ret[0].(string)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// TemplateName indicates an expected call of TemplateName
|
||||
func (mr *MockElemMockRecorder) TemplateName() *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TemplateName", reflect.TypeOf((*MockElem)(nil).TemplateName))
|
||||
}
|
Reference in New Issue
Block a user