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
1 changed files with 7 additions and 0 deletions

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
}