<p dir="auto">Consider the following code (<a href="http://play.golang.org/p/0Sm13cKcq5" rel="nofollow">http://play.golang.org/p/0Sm13cKcq5</a>):</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type A interface {
    Read()
    Write()
}
var a A = 1"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">A</span> <span class="pl-k">interface</span> {
    <span class="pl-c1">Read</span>()
    <span class="pl-c1">Write</span>()
}
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-smi">A</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span></pre></div>
<p dir="auto">This fails to compile with the following message:<br>
<code class="notranslate">"cannot use 1 (type int) as type A in assignment: int does not implement A (missing Read method)"</code></p>
<p dir="auto">The problem is that 'int' also misses the 'Write' method, but it is not disclosed until user works around by defining a custom type and implementing the missing method (only to realize that it was not the only one).</p>
<p dir="auto">This behavior delivers surprises when using complex libraries and writing compartibility layers for them.</p>
<pre class="notranslate">If a type does not implement an interface, the compiler currently only reports one
error. It would be nice if it reported more errors.

<a href="http://play.golang.org/p/ayvTDLAJiZ" rel="nofollow">http://play.golang.org/p/ayvTDLAJiZ</a></pre>