From 87f23d9719afdffb517338dca268978525d96f39 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Mon, 20 Nov 2017 16:48:11 -0500 Subject: [PATCH] add Module method for module name only --- registry/regsrc/module.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/registry/regsrc/module.go b/registry/regsrc/module.go index 05f9bb201..e267f302a 100644 --- a/registry/regsrc/module.go +++ b/registry/regsrc/module.go @@ -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) +}