add Module method for module name only

This commit is contained in:
James Bardin 2017-11-20 16:48:11 -05:00
parent 92db96f783
commit 87f23d9719
1 changed files with 6 additions and 0 deletions

View File

@ -184,3 +184,9 @@ func (m *Module) formatWithPrefix(hostPrefix string, preserveCase bool) string {
}
return str
}
// Module returns just the registry ID of the module, without a hostname or
// suffix.
func (m *Module) Module() string {
return fmt.Sprintf("%s/%s/%s", m.RawNamespace, m.RawName, m.RawProvider)
}