Re: [go-nuts] Extension for type assertion of interface array

2018-04-22 Thread nsakthi93
Type assertion is not required in the given example (from array of structs to interface), But you need to assert if array of one interface is type casted to array of another interface. I started this thread to know whether this pattern requires a language level change to avoid unwanted array

Re: [go-nuts] Extension for type assertion of interface array

2018-04-18 Thread nsakthi93
Usescases that I came across doesn't involve []interface{}. My usecases will be similar to this sample code type landSpace struct { //consider that landSpace implements all functions from both Shape and property interfaces ... } type Shape interface {

[go-nuts] Extension for type assertion of interface array

2018-04-18 Thread nsakthi93
Go supports below type assertion t := i.(T) and t, ok := i.(T) Can this feature be extended to array of interfaces as mentioned below? t := i.([]T) and t, ok := i.([]T) I have been using Golang for almost four years and I have come across use cases