"does not support indexing" : providing indexing with an interface?
<p><a href="https://play.golang.org/p/qxhocI6mjY" rel="nofollow">https://play.golang.org/p/qxhocI6mjY</a></p>

<p>In this play, I get this error : <code>invalid operation: s[0] (type AlmostSlice does not support indexing)</code>
So I am wondering, is it possible to implement indexing ?</p>

<p>Given a struct like this :</p>

<pre><code>type AlmostSlice struct {
    Entities []string
    Id       string
    Stuffs   string
}
</code></pre>

<p>Is it possible to make it support indexing ?</p>

<pre><code>s := AlmostSlice{Id: "bar", Entities: []string{"foo"}}
... := s[0]
s[0] = "stuffs"
</code></pre>

<p>For example, by implementing something like this :</p>

<pre><code>func (s *AlmostSlice) Index(i int) string {
    return s.Entities[i]
}
</code></pre>