Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
snorwin committed Apr 16, 2024
1 parent 2e7f2c0 commit 140e741
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package jsonpatch
import (
"encoding/json"
"reflect"
"slices"
)

// JSONPatch format is specified in RFC 6902
Expand Down Expand Up @@ -40,13 +41,7 @@ func (l JSONPatchList) Raw() []byte {

// List returns a copy of the underlying JSONPatch slice
func (l JSONPatchList) List() []JSONPatch {
ret := make([]JSONPatch, l.Len())

for i, patch := range l.list {
ret[i] = patch
}

return ret
return slices.Clone(l.list)
}

// CreateJSONPatch compares two JSON data structures and creates a JSONPatch according to RFC 6902
Expand Down

0 comments on commit 140e741

Please sign in to comment.