Skip to content

Commit

Permalink
deprecate UnsetByIndex() comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AsterDY committed Dec 29, 2023
1 parent 6483864 commit ea187f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ast/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,10 @@ func (self *Node) SetAnyByIndex(index int, val interface{}) (bool, error) {
return self.SetByIndex(index, NewAny(val))
}

// UnsetByIndex REOMVE (soft) the node of given index
// UnsetByIndex REOMVE (soft) the node of given index.
//
// Deprecated: this will change index of elements, which is a dangerous action.
// Use Unset() for object or Pop() for array instead
func (self *Node) UnsetByIndex(index int) (bool, error) {
if err := self.checkRaw(); err != nil {
return false, err
Expand Down Expand Up @@ -699,6 +702,7 @@ func (self *Node) Pop() error {
return nil
}

// Move moves the child at src index to dst index.
func (self *Node) Move(src, dst int) error {
if err := self.should(types.V_ARRAY, "an array"); err != nil {
return err
Expand Down Expand Up @@ -1405,6 +1409,7 @@ func (self *Node) removePair(i int) {
*last = Pair{}
// NOTICE: should be consistent with linkedPair.Len()
self.l--
if self.
}

Check failure on line 1413 in ast/node.go

View workflow job for this annotation

GitHub Actions / build (1.16.x)

syntax error: unexpected }, expecting name or (

Check failure on line 1413 in ast/node.go

View workflow job for this annotation

GitHub Actions / build (1.17.x)

syntax error: unexpected }, expecting name or (

Check failure on line 1413 in ast/node.go

View workflow job for this annotation

GitHub Actions / build (1.18.x)

syntax error: unexpected }, expecting name or (

Check failure on line 1413 in ast/node.go

View workflow job for this annotation

GitHub Actions / build (1.19.x)

syntax error: unexpected }, expecting name or (

Check failure on line 1413 in ast/node.go

View workflow job for this annotation

GitHub Actions / build (1.20.x)

syntax error: unexpected }, expected name or (

Check failure on line 1413 in ast/node.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

syntax error: unexpected }, expected name or (

func (self *Node) toGenericArray() ([]interface{}, error) {
Expand Down

0 comments on commit ea187f6

Please sign in to comment.