Given the following code:
type NodeType int
const (
NodeText NodeType = iota
NodeAction
// etc..
)
type ListNode struct {
NodeType
}
What is the explanation of including the NodeType
type as an anonymous field in the ListNode
struct? Does it serve as some sort of identifier for the struct?