github.com/opentofu/opentofu@v1.7.1/internal/depsfile/testing.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 depsfile 7 8 import ( 9 "github.com/google/go-cmp/cmp" 10 ) 11 12 // ProviderLockComparer is an option for github.com/google/go-cmp/cmp that 13 // specifies how to compare values of type depsfile.ProviderLock. 14 // 15 // Use this, rather than crafting comparison options yourself, in case the 16 // comparison strategy needs to change in future due to implementation details 17 // of the ProviderLock type. 18 var ProviderLockComparer cmp.Option 19 20 func init() { 21 // For now, direct comparison of the unexported fields is good enough 22 // because we store everything in a normalized form. If that changes 23 // later then we might need to write a custom transformer to a hidden 24 // type with exported fields, so we can retain the ability for cmp to 25 // still report differences deeply. 26 ProviderLockComparer = cmp.AllowUnexported(ProviderLock{}) 27 }