From 47840b0e288c9baf9e94b9f141b3a779735ffade Mon Sep 17 00:00:00 2001 From: Brandur Date: Thu, 2 Nov 2017 11:44:08 -0700 Subject: [PATCH] Rename language fields in Stripe's user agent to start with `lang` I noticed this as I was looking at a dashboard that @ob-stripe produced today. Other languages send language and language version as `lang` and `lang_version` while we were using the fully expanded `language_*` here. I'm changing it here for consistency with other libraries, but I'm also going to patch the server because there are so many Go libraries out there that could potentially be reporting if we supported both styles. --- stripe.go | 4 ++-- stripe_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stripe.go b/stripe.go index 2ac496b5f3..1040ac267d 100644 --- a/stripe.go +++ b/stripe.go @@ -111,8 +111,8 @@ type Backends struct { type stripeClientUserAgent struct { Application *AppInfo `json:"application"` BindingsVersion string `json:"bindings_version"` - Language string `json:"language"` - LanguageVersion string `json:"language_version"` + Language string `json:"lang"` + LanguageVersion string `json:"lang_version"` Publisher string `json:"publisher"` Uname string `json:"uname"` } diff --git a/stripe_test.go b/stripe_test.go index 9dc023f8b7..cfb6b18b55 100644 --- a/stripe_test.go +++ b/stripe_test.go @@ -171,11 +171,11 @@ func TestStripeClientUserAgent(t *testing.T) { assert.Empty(t, userAgent["application"]) assert.Equal(t, "go", userAgent["language"]) - assert.Equal(t, runtime.Version(), userAgent["language_version"]) + assert.Equal(t, runtime.Version(), userAgent["lang"]) // Anywhere these tests are running can reasonable be expected to have a // `uname` to run, so do this basic check. - assert.NotEqual(t, stripe.UnknownPlatform, userAgent["language_version"]) + assert.NotEqual(t, stripe.UnknownPlatform, userAgent["lang"]) } func TestStripeClientUserAgentWithAppInfo(t *testing.T) {