#HVMP-stripego-question

1 messages · Page 1 of 1 (latest)

sonic pagoda
#

hello, not a golang expert but give me a bit to read

past cliff
sonic pagoda
#

ok so I tried to refresh myself on the little golang I know (veeery little)

correct me if I'm wrong here - isn't Error a pointer receiver so that the receiver can be modified by methods and not just a copy is operated on by the methods? And internally in other methods, stripe-go does create a copy off the pointer to do stuff differently if it needs to return a copy. So that was (to my lay-person understanding) on why that decision was (presumably) made

but overall, I don't have the right reasoning on why! I recommend opening an Issue on the stripe-go github repo with your question and the Stripe folks who maintain that library can give you a better answer

past cliff
#

Yeah, I can't know the reasoning, but to me this looks like it wants to be a go interface custom error, and to do so the signature must be func (e MyError) Error() string{} with the receiver not being a pointer.

sonic pagoda
#

do open an issue on stripe-go's Github repo, they should be able to help answer better or take your recommendation into consideration!