<pre class="notranslate">1. What is a short input program that triggers the error?
package main

const a string = b(0)

func main() {
    println(a)
}

2. What is the full compiler output?
test.go:3: undefined: b
test.go:3: cannot use b(0) as type string in const initializer
test.go:6: internal compiler error: naddr: const string

Interestingly, changing the const line to either:

const a = b(0)
or
const a int = b(0)

gets rid of the internal compiler error (but not the other errors, of course).

3. What version of the compiler are you using?  (Run it with the -V flag.)
g version weekly.2011-06-16 8815+</pre>
<p dir="auto">It would be nice if clients of the net/smtp package could access the TLS connection state in order to implement server certificate hash checking with STARTTLS.  Currently net/smtp's <code class="notranslate">(c *Client)</code> does not expose the <code class="notranslate">conn</code> field, which is set during <code class="notranslate">(c *Client) StartTLS()</code>.<br>
<a href="https://github.com/golang/go/blob/go1.4/src/net/smtp/smtp.go#L154">https://github.com/golang/go/blob/go1.4/src/net/smtp/smtp.go#L154</a></p>
<p dir="auto">As an example, this is the kind of server certificate hash checking I'd like to do with net/smtp:<br>
<a href="https://github.com/agl/xmpp/blob/a5b10608a5c441a99c6380efa91d7f4fb517e9c2/xmpp.go#L509-517">https://github.com/agl/xmpp/blob/a5b10608a5c441a99c6380efa91d7f4fb517e9c2/xmpp.go#L509-517</a></p>
<p dir="auto">I ended up forking net/smtp in order to access the TLS connection state after STARTTLS, which is a lot of code duplication for such a small change.  If this isn't too esoteric, an additional method on smtp's Client struct could expose the connection state to clients of the package, making server certificate hash verification possible.</p>