crypto/x509: fix panic in TestEnvVars, improve style
crypto/x509: fix panic in TestEnvVars, improve style

This panic happens when the test fails due to the returned number of
certificates (r.certs) being less than expected by test case (tc.cns).
When i == len(r.certs) in the for loop, r.certs[i] will cause an index
out of range panic.

Also improve readability, consistency and style of the code. Use the
more common "got x, want y" pattern. See https://golang.org/s/style#useful-test-failures
for reference (and grep codebase for most common occurrences). Add a
comment, and remove blank line separating two blocks that are both
related to verifying that len(r.certs) == len(tc.cns). This should
help with readability.

Remove space after colon in call to t.Fatal, since it adds spaces
between its arguments.

Fixes #20801.

Change-Id: I40476103f1b5a0fa74b05637c250926b571c92fd
Reviewed-on: https://go-review.googlesource.com/46715
Run-TryBot: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>
TryBot-Result: Gobot Gobot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Brad Fitzpatrick <ae9783c0b0efc69cd85ab025ddd17aa44cdc4aa5@golang.org>

akutz/go,polyverse-security/go,Cofyc/go,nawawi/go,akutz/go,cloudflare/go,vsekhar/elastic-go,Cofyc/go,nawawi/go,golang/go,nawawi/go,CAFxX/go,codestation/go,vsekhar/elastic-go,josharian/go,josharian/go,CAFxX/go,cloudflare/go,polyverse-security/go,golang/go,CAFxX/go,josharian/go,Cofyc/go,akutz/go,nawawi/go,Cofyc/go,nawawi/go,codestation/go,codestation/go,cloudflare/go,nawawi/go,polyverse-security/go,CAFxX/go,christopher-henderson/Go,golang/go,codestation/go,Cofyc/go,akutz/go,codestation/go,CAFxX/go,cloudflare/go,CAFxX/go,vsekhar/elastic-go,Cofyc/go,vsekhar/elastic-go,josharian/go,polyverse-security/go,codestation/go,vsekhar/elastic-go,polyverse-security/go,codestation/go,josharian/go,CAFxX/go,golang/go,polyverse-security/go,codestation/go,Cofyc/go,josharian/go,golang/go,nawawi/go,nawawi/go,polyverse-security/go,cloudflare/go,cloudflare/go,golang/go,CAFxX/go,vsekhar/elastic-go,akutz/go,cloudflare/go,josharian/go,polyverse-security/go,akutz/go,vsekhar/elastic-go,golang/go,josharian/go,cloudflare/go,vsekhar/elastic-go,golang/go,Cofyc/go,akutz/go,akutz/go