Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockBaseClient broken by 1.20.0 update which changed the function signature of SendRequest #244

Closed
saurori opened this issue Apr 20, 2024 · 2 comments · Fixed by #246
Closed

Comments

@saurori
Copy link

saurori commented Apr 20, 2024

Issue Summary

Version 1.20.0 changed the BaseClient SendRequest method (seen in this pull request) to add body ...byte as a function parameter. The corresponding MockBaseClient was not updated.

Steps to Reproduce

  1. Use twilio-go version 1.20.1
  2. Attempt to use a MockBaseClient (see code below)

Code Snippet

ctrl := gomock.NewController(t)
c := client.NewMockBaseClient(ctrl)
twilioClient := twilio.NewRestClientWithParams(twilio.ClientParams{Client: c})

Exception/Log

cannot use c (variable of type *client.MockBaseClient) as client.BaseClient value in struct literal: *client.MockBaseClient does not implement client.BaseClient (wrong type for method SendRequest)
		have SendRequest(string, string, url.Values, map[string]interface{}) (*http.Response, error)
		want SendRequest(string, string, url.Values, map[string]interface{}, ...byte) (*http.Response, error)compiler[InvalidIfaceAssign](https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#InvalidIfaceAssign)

Technical details:

  • twilio-go version: 1.20.1
  • go version: go version go1.22.2 darwin/arm64
@sbansla
Copy link
Contributor

sbansla commented Apr 21, 2024

Let me take a look into this.

@tiwarishubham635
Copy link
Contributor

Hey @saurori!
I have created a PR #246 for this. Please check.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants