code: func (s *State) RemoveModule(addr addrs.ModuleInstance) {
  	if addr.IsRoot() {
  		panic("attempted to remove root module")
  	}
  
  	delete(s.Modules, addr.String())
  }
docs: // RemoveModule removes the module with the given address from the state,
  // unless it is the root module. The root module cannot be deleted, and so
  // this method will panic if that is attempted.
  //
  // Removing a module implicitly discards all of the resources, outputs and
  // local values within it, and so this should usually be done only for empty
  // modules. For callers accessing the state through a SyncState wrapper, modules
  // are automatically pruned if they are empty after one of their contained
  // elements is removed.