From 345d0c3e2b4ce456b4b513cea04e22e698ed031b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Tue, 10 May 2016 16:55:11 +0200 Subject: [PATCH] Reset a json.Unmarshal destination right before the call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … similar to how we do it in other places. --- signature/signature_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signature/signature_test.go b/signature/signature_test.go index edce1869..1c9fc321 100644 --- a/signature/signature_test.go +++ b/signature/signature_test.go @@ -62,6 +62,7 @@ func tryUnmarshalModifiedSignature(t *testing.T, sig *privateSignature, validJSO testJSON, err := json.Marshal(tmp) require.NoError(t, err) + *sig = privateSignature{} return json.Unmarshal(testJSON, sig) } @@ -140,7 +141,6 @@ func TestUnmarshalJSON(t *testing.T) { func(v mSI) { delete(x(v, "optional"), "creator") }, } for _, fn := range allowedModificationFns { - s = privateSignature{} err = tryUnmarshalModifiedSignature(t, &s, validJSON, fn) require.NoError(t, err) assert.Equal(t, validSig, s)