1
0
mirror of https://github.com/go-task/task.git synced 2025-03-19 21:17:46 +02:00
task/taskfile/read/node_base.go
Pete Davison afe8a618fe
feat: node refactor (#1316)
* refactor: node reader interface

* refactor: rewrite Taskfile() as anon recursive func

* chore: NewNodeFromIncludedTaskfile

* chore: changelog
2023-09-02 21:24:01 +01:00

19 lines
466 B
Go

package read
// BaseNode is a generic node that implements the Parent() and Optional()
// methods of the NodeReader interface. It does not implement the Read() method
// and it designed to be embedded in other node types so that this boilerplate
// code does not need to be repeated.
type BaseNode struct {
parent Node
optional bool
}
func (node *BaseNode) Parent() Node {
return node.parent
}
func (node *BaseNode) Optional() bool {
return node.optional
}