Skip to content

Commit

Permalink
Merge pull request #173 from kl52752/differ-fix-path
Browse files Browse the repository at this point in the history
Deep copy path in Differ Results
  • Loading branch information
google-oss-prow[bot] authored Mar 5, 2024
2 parents b7ec13c + a435cf9 commit 7926f30
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cloud/api/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ type DiffResult struct {
func (r *DiffResult) HasDiff() bool { return len(r.Items) > 0 }

func (r *DiffResult) add(state DiffItemState, p Path, a, b reflect.Value) {

di := DiffItem{
State: state,
Path: p,
Path: make([]string, len(p)),
}
copy(di.Path, p)
if a.IsValid() {
// Interface() will panic if is called on unexported types in this case
// the best we can do is to pass its name to the result.
Expand Down

0 comments on commit 7926f30

Please sign in to comment.