add example for the reason behind versionedPathKey

This commit is contained in:
James Bardin 2017-10-27 09:01:45 -04:00
parent d6f75cc022
commit 9bda82ccf1
1 changed files with 3 additions and 0 deletions

View File

@ -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