addrs: ModuleInstanceStep.String

When ModuleInstanceStep values appear alone in debug messages, it's easier
to read them in a compact, HCL-like form than as the default struct
printing style.
This commit is contained in:
Martin Atkins 2019-11-21 15:37:44 -08:00
parent 678760b61a
commit 9f727b5799

View File

@ -413,3 +413,10 @@ func (m ModuleInstance) TargetContains(other Targetable) bool {
func (m ModuleInstance) targetableSigil() {
// ModuleInstance is targetable
}
func (s ModuleInstanceStep) String() string {
if s.InstanceKey != NoKey {
return s.Name + s.InstanceKey.String()
}
return s.Name
}