code: func (d *Diff) ModuleByPath(path addrs.ModuleInstance) *ModuleDiff {
  	if d == nil {
  		return nil
  	}
  	for _, mod := range d.Modules {
  		if mod.Path == nil {
  			panic("missing module path")
  		}
  		modPath := normalizeModulePath(mod.Path)
  		if modPath.String() == path.String() {
  			return mod
  		}
  	}
  	return nil
  }
docs: // ModuleByPath is used to lookup the module diff for the given path.
  // This should be the preferred lookup mechanism as it allows for future
  // lookup optimizations.