fluent interface for node SetAttribure
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
type NameNode struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
parts []node.Node
|
||||
}
|
||||
|
||||
@@ -32,8 +32,9 @@ func (n NameNode) Attribute(key string) interface{} {
|
||||
return n.attributes[key]
|
||||
}
|
||||
|
||||
func (n NameNode) SetAttribute(key string, value interface{}) {
|
||||
func (n NameNode) SetAttribute(key string, value interface{}) node.Node {
|
||||
n.attributes[key] = value
|
||||
return n
|
||||
}
|
||||
|
||||
func (n NameNode) Position() *node.Position {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
type NamePart struct {
|
||||
name string
|
||||
attributes map[string]interface{}
|
||||
position *node.Position
|
||||
position *node.Position
|
||||
}
|
||||
|
||||
func NewNamePart(value string) node.Node {
|
||||
@@ -32,8 +32,9 @@ func (n NamePart) Attribute(key string) interface{} {
|
||||
return n.attributes[key]
|
||||
}
|
||||
|
||||
func (n NamePart) SetAttribute(key string, value interface{}) {
|
||||
func (n NamePart) SetAttribute(key string, value interface{}) node.Node {
|
||||
n.attributes[key] = value
|
||||
return n
|
||||
}
|
||||
|
||||
func (n NamePart) Position() *node.Position {
|
||||
|
||||
Reference in New Issue
Block a user