Polymorphism in Go lang
<p>I am learning go lang and i was wondering if there is a way to do something like this:</p>

<pre><code>type Foo struct {
   ...
}

type Bar struct {
   Foo
   ...
}

func getFoo() Foo {
   return Bar{...}
}
</code></pre>

<p>In an object oriented language, such code should work without problems, but in go it throws me an error, saying that <code>getFoo()</code> must return an instance of class Foo.</p>

<p>Is there a way to do polymorphism similar to what i've described in Go?</p>