code: func (s *State) Validate() error {
  	s.Lock()
  	defer s.Unlock()
  
  	var result error
  
  	// !!!! FOR DEVELOPERS !!!!
  	//
  	// Any errors returned from this Validate function will BLOCK TERRAFORM
  	// from loading a state file. Therefore, this should only contain checks
  	// that are only resolvable through manual intervention.
  	//
  	// !!!! FOR DEVELOPERS !!!!
  
  	// Make sure there are no duplicate module states. We open a new
  	// block here so we can use basic variable names and future validations
  	// can do the same.
  	{
  		found := make(map[string]struct{})
  		for _, ms := range s.Modules {
  			if ms == nil {
  				continue
  			}
  
  			key := strings.Join(ms.Path, ".")
  			if _, ok := found[key]; ok {
  				result = multierror.Append(result, fmt.Errorf(
  					strings.TrimSpace(stateValidateErrMultiModule), key))
  				continue
  			}
  
  			found[key] = struct{}{}
  		}
  	}
  
  	return result
  }
docs: // Validate validates the integrity of this state file.
  //
  // Certain properties of the statefile are expected by Terraform in order
  // to behave properly. The core of Terraform will assume that once it
  // receives a State structure that it has been validated. This validation
  // check should be called to ensure that.
  //
  // If this returns an error, then the user should be notified. The error
  // response will include detailed information on the nature of the error.