code: func (s *State) ModuleByPath(path addrs.ModuleInstance) *ModuleState {
  	if s == nil {
  		return nil
  	}
  	s.Lock()
  	defer s.Unlock()
  
  	return s.moduleByPath(path)
  }
docs: // ModuleByPath is used to lookup the module state for the given path.
  // This should be the preferred lookup mechanism as it allows for future
  // lookup optimizations.