Hierarchical types in Go

Services exposed by a hierarchical data model are node specific.Using those can be dynamic using type switches in Go, without scarifying simplicity. Each level is implemented by a set of interfaces which are grouped in a type switch.Further, type switches for all levels can be nested. Keeping separate type switch for each level improves code readability To start with, consider below diagram : Each level in model is implemented by specific set of interfaces.(Each node is has interface in this example): Interface set for Root : type RootInterface interface{ RootFunc() } Interface set for Level One : type L1c1 interface{//Level One Child one. »