I had some Redis code that relied on the Proto standard for marshalling/unmarshalling of data. I wrote the following test using gomega to test around proto.Unmarshal:
b64Decoded, err := base64.StdEncoding.DecodeString("derp")
Expect(err).ShouldNot(HaveOccurred())
var item testRecord
err = proto.Unmarshal(b64Decoded, &item)
Expect(err).Should(HaveOccurred())
Expect(err.Error()).Should(Equal("proto:\u00a0cannot parse invalid wire-format data"))
However, the final assertion fails because the expected error string was proto: cannot parse invalid wire-format data. The obvious solution here is to change it, and when I do, the error goes away. Until I modify the test and rerun it, in which case the test again fails telling me that the string should've been proto:\u00a0cannot parse invalid wire-format data. This cycle continues infinitely. So, what am I doing wrong here and how do I fix this?