Playground url: https://play.golang.org/p/tDT7xCJJ_XN
திங்., 15 ஏப்., 2019, பிற்பகல் 4:01 அன்று, Sankar < sankar.curios...@gmail.com> எழுதியது: > I have the following go code: > > ``` > type A map[string]interface{} > type B map[string]interface{} > > func f(a A) { > fmt.Println(a) > } > > func main() { > var b B > b = make(map[string]interface{}) > i := interface{}(b) > f(i.(A)) > } > ``` > > This code panics when I try to convert the B instance to type A. What is > the right way to do the cast here ? > > -- > You received this message because you are subscribed to a topic in the > Google Groups "golang-nuts" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/golang-nuts/f3jarN-BgC0/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Sankar P http://psankar.blogspot.com -- 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 golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.