From 88ad938cc670d43496c60bc9c3948786a448dd80 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 5 Aug 2021 15:55:28 -0400 Subject: [PATCH] Equal methods for move AbsMoveable Make sure all the types are comparable --- internal/addrs/module_call.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/addrs/module_call.go b/internal/addrs/module_call.go index 4e8ce34f2..709b1e302 100644 --- a/internal/addrs/module_call.go +++ b/internal/addrs/module_call.go @@ -37,6 +37,10 @@ func (c ModuleCall) Absolute(moduleAddr ModuleInstance) AbsModuleCall { } } +func (c ModuleCall) Equal(other ModuleCall) bool { + return c.Name == other.Name +} + // AbsModuleCall is the address of a "module" block relative to the root // of the configuration. // @@ -70,6 +74,10 @@ func (c AbsModuleCall) Instance(key InstanceKey) ModuleInstance { return ret } +func (c AbsModuleCall) Equal(other AbsModuleCall) bool { + return c.Module.Equal(other.Module) && c.Call.Equal(other.Call) +} + type absModuleCallInstanceKey string func (c AbsModuleCall) UniqueKey() UniqueKey {