opentofu/internal/depsfile/testing.go
Martin Atkins b3f5c7f1e6 command/init: Read, respect, and update provider dependency locks
This changes the approach used by the provider installer to remember
between runs which selections it has previously made, using the lock file
format implemented in internal/depsfile.

This means that version constraints in the configuration are considered
only for providers we've not seen before or when -upgrade mode is active.
2020-10-09 09:26:23 -07:00

23 lines
822 B
Go

package depsfile
import (
"github.com/google/go-cmp/cmp"
)
// ProviderLockComparer is an option for github.com/google/go-cmp/cmp that
// specifies how to compare values of type depsfile.ProviderLock.
//
// Use this, rather than crafting comparison options yourself, in case the
// comparison strategy needs to change in future due to implementation details
// of the ProviderLock type.
var ProviderLockComparer cmp.Option
func init() {
// For now, direct comparison of the unexported fields is good enough
// because we store everything in a normalized form. If that changes
// later then we might need to write a custom transformer to a hidden
// type with exported fields, so we can retain the ability for cmp to
// still report differences deeply.
ProviderLockComparer = cmp.AllowUnexported(ProviderLock{})
}