jarcoal / httpmock

HTTP mocking for Golang
http://godoc.org/github.com/jarcoal/httpmock
MIT License
1.93k stars 103 forks source link

Augment RegisterResponderWithQuery function #61

Closed maxatome closed 5 years ago

maxatome commented 5 years ago

Could replace #55 & #57 what do you think of this, @Zanadar and @kardolus?

RegisterResponderWithQueryValues can be renamed if you have a better idea.

maxatome commented 5 years ago

@Zanadar I agree that having both RegisterResponderWithQueryValues and RegisterResponderWithQuery is confusing. I agree too that RegisterResponderWithQuery should never be released as is, but it is done now. Refering to RegisterResponderWithQueryValues in RegisterResponderWithQuery doc is a step to avoid confusion...

Of course we can bump the major version, but I prefer not. IMO having a new branch will add more confusion than having 2 similar but well documented methods, even if the API is not as clean as it could be in this case.

Note that if you have a better name for RegisterResponderWithQueryValues, do not hesitate to propose it.

By the way, RegisterResponderWithQuery now calls RegisterResponderWithQueryValues as you rightly suggested.

maxatome commented 5 years ago

@Zanadar I just merged RegisterResponderWithQueryValues in RegisterResponderWithQuery. If this design seems correct to you, I will complete unit testing of this stuff.

maxatome commented 5 years ago

Unit tests OK.