mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
All of our MoveDestination methods have the common problem of deciding whether the receiver is even potentially in the scope of a particular MoveEndpointInModule, which requires that the receiver belong to an instance of the module where the move statement was found. Previously we had this logic inline in all three cases, but now we'll factor it out into a shared helper function. At first it seemed like there ought to be more factoring possible for the AbsResource vs. AbsResourceInstance implementations, since textually they look very similar, but in practice they only look similar because those two types have a lot of method names in common, but the Go compiler sees them as completely distinct and thus we must write the same logic out twice. I did try some further refactoring to address that but it made the resulting code significantly more complicated and, by my judgement, harder to follow. Consequently I decided that a little duplication was okay and warranted here because this logic is already quite fiddly to read through and isn't likely to change significantly once released (due to backward-compatibility promises). |
||
---|---|---|
.. | ||
count_attr.go | ||
doc.go | ||
for_each_attr.go | ||
input_variable.go | ||
instance_key.go | ||
local_value.go | ||
module_call.go | ||
module_instance_test.go | ||
module_instance.go | ||
module_package.go | ||
module_source_test.go | ||
module_source.go | ||
module_test.go | ||
module.go | ||
move_endpoint_kind.go | ||
move_endpoint_module_test.go | ||
move_endpoint_module.go | ||
move_endpoint_test.go | ||
move_endpoint.go | ||
moveable.go | ||
moveendpointkind_string.go | ||
output_value_test.go | ||
output_value.go | ||
parse_ref_test.go | ||
parse_ref.go | ||
parse_target_test.go | ||
parse_target.go | ||
path_attr.go | ||
provider_config_test.go | ||
provider_config.go | ||
provider_test.go | ||
provider.go | ||
referenceable.go | ||
resource_phase.go | ||
resource_test.go | ||
resource.go | ||
resourcemode_string.go | ||
self.go | ||
set.go | ||
target_test.go | ||
targetable.go | ||
terraform_attr.go | ||
unique_key_test.go | ||
unique_key.go |