"instanceof" equivalent in Golang
<p>I have these structs:</p>
<pre><code>type Event interface {
    Accept(EventVisitor)
}

type Like struct {
}

func (l *Like) Accept(visitor EventVisitor) {
    visitor.visitLike(l)
}
</code></pre>
<p>How can I test that <code>event</code> is a <code>Like</code> instance?</p>
<pre><code>func TestEventCreation(t *testing.T) {
    event, err := New(0)
    if err != nil {
        t.Error(err)
    }
    if reflect.TypeOf(event) != Like {
        t.Error(&quot;Assertion error&quot;)
    }
}
</code></pre>
<p>I get:</p>
<blockquote>
<p>Type Like is not an expression event Event</p>
</blockquote>