Skip to content

Commit

Permalink
Fixes #1 RemoveChild() has a typo in the append() parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
subchen authored Sep 18, 2017
1 parent 93fb829 commit 63d6b99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (n *Node) SetAttributeValue(name string, value string) *Node {
func (n *Node) RemoveAttribute(name string) *Node {
for i, attr := range n.Attributes {
if attr.Name == name {
n.Attributes = append(n.Attributes[:1], n.Attributes[i+1:]...)
n.Attributes = append(n.Attributes[:i], n.Attributes[i+1:]...)
break
}
}
Expand Down Expand Up @@ -136,7 +136,7 @@ func (n *Node) AppendChild(c *Node) *Node {
func (n *Node) RemoveChild(c *Node) *Node {
for i, a := range n.Children {
if a == c {
n.Children = append(n.Children[:1], n.Children[i+1:]...)
n.Children = append(n.Children[:i], n.Children[i+1:]...)
break
}
}
Expand Down

0 comments on commit 63d6b99

Please sign in to comment.