From 696b403bf36ec0e9683588f5c8be8ae23425a7cc Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 14 Jun 2022 17:13:53 -0700 Subject: [PATCH] addrs: OutputValue.InModule Similar to other address types, this wraps the receiver up in its associated "config" type, binding it to a particular not-yet-expanded module. --- internal/addrs/output_value.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/addrs/output_value.go b/internal/addrs/output_value.go index 4970eee9a4..9fc016cb30 100644 --- a/internal/addrs/output_value.go +++ b/internal/addrs/output_value.go @@ -32,6 +32,15 @@ func (v OutputValue) Absolute(m ModuleInstance) AbsOutputValue { } } +// InModule converts the receiver into a config address within the given +// module. +func (v OutputValue) InModule(m Module) ConfigOutputValue { + return ConfigOutputValue{ + Module: m, + OutputValue: v, + } +} + // AbsOutputValue is the absolute address of an output value within a module instance. // // This represents an output globally within the namespace of a particular