Apply goimports' modifications
This commit is contained in:
@@ -44,7 +44,7 @@ func StartMock() Stub {
|
||||
return mockFilter
|
||||
}
|
||||
|
||||
func CtxWithMock(ctx context.Context, mock... *Mock) context.Context {
|
||||
func CtxWithMock(ctx context.Context, mock ...*Mock) context.Context {
|
||||
return context.WithValue(ctx, mockCtxKey, mock)
|
||||
}
|
||||
|
||||
@@ -73,8 +73,6 @@ func NewMock(con RequestCondition, resp *http.Response, err error) *Mock {
|
||||
return &Mock{
|
||||
cond: con,
|
||||
resp: resp,
|
||||
err: err,
|
||||
err: err,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +120,6 @@ func (sc *SimpleCondition) matchBodyFields(ctx context.Context, req *httplib.Bee
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
m := make(map[string]interface{})
|
||||
|
||||
err = json.Unmarshal(bytes, &m)
|
||||
|
||||
@@ -72,6 +72,6 @@ func OriginnalCodeUsingHttplibPassCtx(ctx context.Context) (*http.Response, erro
|
||||
return httplib.Get("http://localhost:7777/abc").DoRequestWithCtx(ctx)
|
||||
}
|
||||
|
||||
func OriginalCodeUsingHttplib() (*http.Response, error){
|
||||
func OriginalCodeUsingHttplib() (*http.Response, error) {
|
||||
return httplib.Get("http://localhost:7777/abc").DoRequest()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user