瀏覽代碼

openpgp: fix vet issue in tests

https://golang.org/cl/111416 made vet spot this new issue by recognizing
the len() call as side-effect free:

    redundant or: md.IsSymmetricallyEncrypted || md.IsSymmetricallyEncrypted

Change-Id: I8b72eedb458365a50e14d5eec35b972ee61efb1f
Reviewed-on: https://go-review.googlesource.com/112255
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Filippo Valsorda 7 年之前
父節點
當前提交
21052ae466
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      openpgp/read_test.go

+ 1 - 1
openpgp/read_test.go

@@ -124,7 +124,7 @@ func checkSignedMessage(t *testing.T, signedHex, expected string) {
 		return
 		return
 	}
 	}
 
 
-	if !md.IsSigned || md.SignedByKeyId != 0xa34d7e18c20c31bb || md.SignedBy == nil || md.IsEncrypted || md.IsSymmetricallyEncrypted || len(md.EncryptedToKeyIds) != 0 || md.IsSymmetricallyEncrypted {
+	if !md.IsSigned || md.SignedByKeyId != 0xa34d7e18c20c31bb || md.SignedBy == nil || md.IsEncrypted || md.IsSymmetricallyEncrypted || len(md.EncryptedToKeyIds) != 0 || md.DecryptedWith != (Key{}) {
 		t.Errorf("bad MessageDetails: %#v", md)
 		t.Errorf("bad MessageDetails: %#v", md)
 	}
 	}