Breaking change on some `Del` functions in stripe-go 25.0.0

Skip to first unread message


Aug 21, 2017, 3:48:22 PM8/21/17
to Stripe API Announcements
Hello list,

Through an accident of history, many of the Go library's
delete functions took a single `id` argument:

    func Del(id string) (*Customer, error) {

This was in contrast to other API operations which take a
second typed parameter struct:

    func Get(id string, params *CustomerParams) (*stripe.Customer, error) {

Although mainly intended to facilitate create/update
values, that second parameter also enables special options
to be passed with an API call like `Stripe-Account` and
`Idempotency-Key`. Its absence on some delete methods meant
that these options were effectively unavailable for those

Today we released stripe-go 25.0.0 which introduces a
breaking change [1] by adding a parameters argument to all
delete functions that were missing one (thank you Remi for
doing the work). For example:

    func Del(id string, params *CustomerParams) (*Customer, error) {

In all cases `params` is allowed to be `nil`, so a simple
fix when you're upgrading will be to just add `nil`
argument to any functions that are producing a compilation

Sorry about the extra churn this causes. We made the change
because although it'll be an upgrade annoyance, it'll help
new users significantly by conforming to the principle of
least astonishment [2].

Stripe API Engineering

Reply all
Reply to author
0 new messages