github.com/opentofu/opentofu@v1.7.1/internal/command/jsonformat/differ/differ.go (about)

     1  // Copyright (c) The OpenTofu Authors
     2  // SPDX-License-Identifier: MPL-2.0
     3  // Copyright (c) 2023 HashiCorp, Inc.
     4  // SPDX-License-Identifier: MPL-2.0
     5  
     6  package differ
     7  
     8  import (
     9  	"github.com/opentofu/opentofu/internal/command/jsonformat/computed"
    10  	"github.com/opentofu/opentofu/internal/command/jsonformat/structured"
    11  )
    12  
    13  // asDiff is a helper function to abstract away some simple and common
    14  // functionality when converting a renderer into a concrete diff.
    15  func asDiff(change structured.Change, renderer computed.DiffRenderer) computed.Diff {
    16  	return computed.NewDiff(renderer, change.CalculateAction(), change.ReplacePaths.Matches())
    17  }