code: func getStateFromEnv(b backend.Backend, env string) (*statefile.File, error) {
  	// Get the state
  	stateStore, err := b.StateMgr(env)
  	if err != nil {
  		return nil, fmt.Errorf("Failed to load state manager: %s", err)
  	}
  
  	if err := stateStore.RefreshState(); err != nil {
  		return nil, fmt.Errorf("Failed to load state: %s", err)
  	}
  
  	sf := statemgr.Export(stateStore)
  
  	return sf, nil
  }
docs: // getStateFromEnv returns the State for the current workspace, if available.