How to have a map of `int`s to the type `X` or to the type `Y`? Or, How to do union types in Go via interfaces?

前端 未结 0 1519
抹茶落季
抹茶落季 2021-01-29 04:00

In the code snippet below (Go Playground), I\'m defining two structs X and Y who implement the Variable interface. My intention is to have

相关标签:
回答
  • 消灭零回复
提交回复
热议问题