~rootmos/go-pkg-proxy

b515afbfe58c4741522d3be003d617fec653ed38 — Gustav Behm 4 months ago 9c0834d
Copy module when building map
1 files changed, 3 insertions(+), 2 deletions(-)

M main.go
M main.go => main.go +3 -2
@@ 37,14 37,15 @@ func FetchModules(ctx context.Context, url string) (Modules, error) {

	modules := make(Modules)
	for _, m := range raw {
		mod := m
		if m.Name != "" {
			logger.Debug("module", "name", m.Name, "definition", m)
			modules[m.Name] = &m
			modules[m.Name] = &mod
		}

		for _, n := range m.Names {
			logger.Debug("module", "name", n, "definition", m)
			modules[n] = &m
			modules[n] = &mod
		}
	}