/
MultiError.go
146 lines (115 loc) · 2.97 KB
/
MultiError.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// Code generated by mockery v2.42.1. DO NOT EDIT.
package mocks
import (
candihelper "github.com/golangid/candi/candihelper"
mock "github.com/stretchr/testify/mock"
)
// MultiError is an autogenerated mock type for the MultiError type
type MultiError struct {
mock.Mock
}
// Append provides a mock function with given fields: key, err
func (_m *MultiError) Append(key string, err error) candihelper.MultiError {
ret := _m.Called(key, err)
if len(ret) == 0 {
panic("no return value specified for Append")
}
var r0 candihelper.MultiError
if rf, ok := ret.Get(0).(func(string, error) candihelper.MultiError); ok {
r0 = rf(key, err)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(candihelper.MultiError)
}
}
return r0
}
// Clear provides a mock function with given fields:
func (_m *MultiError) Clear() {
_m.Called()
}
// Error provides a mock function with given fields:
func (_m *MultiError) Error() string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for Error")
}
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// HasError provides a mock function with given fields:
func (_m *MultiError) HasError() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for HasError")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// IsNil provides a mock function with given fields:
func (_m *MultiError) IsNil() bool {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for IsNil")
}
var r0 bool
if rf, ok := ret.Get(0).(func() bool); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// Merge provides a mock function with given fields: _a0
func (_m *MultiError) Merge(_a0 candihelper.MultiError) candihelper.MultiError {
ret := _m.Called(_a0)
if len(ret) == 0 {
panic("no return value specified for Merge")
}
var r0 candihelper.MultiError
if rf, ok := ret.Get(0).(func(candihelper.MultiError) candihelper.MultiError); ok {
r0 = rf(_a0)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(candihelper.MultiError)
}
}
return r0
}
// ToMap provides a mock function with given fields:
func (_m *MultiError) ToMap() map[string]string {
ret := _m.Called()
if len(ret) == 0 {
panic("no return value specified for ToMap")
}
var r0 map[string]string
if rf, ok := ret.Get(0).(func() map[string]string); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(map[string]string)
}
}
return r0
}
// NewMultiError creates a new instance of MultiError. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewMultiError(t interface {
mock.TestingT
Cleanup(func())
}) *MultiError {
mock := &MultiError{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}