code: func normalizeModulePath(p []string) addrs.ModuleInstance {
  	// FIXME: Remove this once everyone is using addrs.ModuleInstance.
  
  	if len(p) > 0 && p[0] == "root" {
  		p = p[1:]
  	}
  
  	ret := make(addrs.ModuleInstance, len(p))
  	for i, name := range p {
  		// For now we don't actually support modules with multiple instances
  		// identified by keys, so we just treat every path element as a
  		// step with no key.
  		ret[i] = addrs.ModuleInstanceStep{
  			Name: name,
  		}
  	}
  	return ret
  }
docs: // normalizeModulePath transforms a legacy module path (which may or may not
  // have a redundant "root" label at the start of it) into an
  // addrs.ModuleInstance representing the same module.
  //
  // For legacy reasons, different parts of Terraform disagree about whether the
  // root module has the path []string{} or []string{"root"}, and so this
  // function accepts both and trims off the "root". An implication of this is
  // that it's not possible to actually have a module call in the root module
  // that is itself named "root", since that would be ambiguous.
  //
  // normalizeModulePath takes a raw module path and returns a path that
  // has the rootModulePath prepended to it. If I could go back in time I
  // would've never had a rootModulePath (empty path would be root). We can
  // still fix this but thats a big refactor that my branch doesn't make sense
  // for. Instead, this function normalizes paths.