diff options
Diffstat (limited to 'model/booleanNode.go')
-rw-r--r-- | model/booleanNode.go | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/model/booleanNode.go b/model/booleanNode.go deleted file mode 100644 index aba286e..0000000 --- a/model/booleanNode.go +++ /dev/null @@ -1,27 +0,0 @@ -package model - -import "fmt" - -type BooleanNode struct { - Value bool -} - -func (n BooleanNode) Type() NodeType { - return BooleanType -} - -func (n *BooleanNode) MarshalJSON() ([]byte, error) { - if n.Value { - return []byte("true"), nil - } - return []byte("false"), nil -} - -func (n *BooleanNode) Set(v any) error { - val, ok := v.(bool) - if !ok { - return fmt.Errorf("%v is not boolean", v) - } - n.Value = val - return nil -} |