aws / aws-sdk-go-v2

AWS SDK for the Go programming language.
https://aws.github.io/aws-sdk-go-v2/docs/
Apache License 2.0
2.68k stars 650 forks source link

fix potential for user-agent lang value mismatch in tests #2888

Closed lucix-aws closed 3 weeks ago

lucix-aws commented 3 weeks ago

runtime.Version() may have extra data after the semver string that tests weren't accounting for (they were not normalizing it in the "expect" input, this fixes that)

Madrigal commented 3 weeks ago

LGTM, just 2 nits

  1. Can we describe better what the actual issue with this was on the PR? offline there was a good explanation of it
  2. The current error message is rather unhelpful

t.Error("User-Agent did not match expected")

Can we change the error message to

t.Error("User-Agent %v did not match expected %v", ua[0], c.Expect)

lucix-aws commented 3 weeks ago

Fixed, merge on CI pass.