From 9bda82ccf184fb91357dec33929b769998c7e5ec Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 27 Oct 2017 09:01:45 -0400 Subject: [PATCH] add example for the reason behind versionedPathKey --- config/module/tree.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/module/tree.go b/config/module/tree.go index dbbe0a480..24b40cba1 100644 --- a/config/module/tree.go +++ b/config/module/tree.go @@ -638,6 +638,9 @@ func (t *Tree) Validate() error { // and source encoded. This is to provide a unique key for our module storage, // since submodules need to know which versions of their ancestor modules they // are loaded from. +// For example, if module A has a subdirectory B, if module A's source or +// version is updated B's storage key must reflect this change in order for the +// correct version of B's source to be loaded. func (t *Tree) versionedPathKey(m *Module) string { path := make([]string, len(t.path)+1) path[len(path)-1] = m.Name + ";" + m.Source