Usescases that I came across doesn't involve []interface{}.
My usecases will be similar to this sample code
<https://play.golang.org/p/LezKzpiMndl>
type landSpace struct {
//consider that landSpace implements all functions from both Shape and
property interfaces
...
}
type Shape interface {
...
}
type property interface {
...
}
var a []*landSpace
func processShapes(shapes []Shape) {
//....
}
func evaluateProperties(properties []Property) {
//....
}
If I want to pass the variable 'a' to both the functions, then I have to
write two functions to clone and typeAssert to respective interfaces.
On Wednesday, 18 April 2018 19:53:33 UTC+5:30, Jan Mercl wrote:
>
> On Wed, Apr 18, 2018 at 4:13 PM <[email protected] <javascript:>> wrote:
>
> When possible, avoid using '[]interface{}' and use just 'interface{}'
> instead: https://play.golang.org/p/oPtPoGChkMZ.
>
>
> --
>
> -j
>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.