code: func getPlanFromPath(path string) (*plans.Plan, error) {
  	pr, err := planfile.Open(path)
  	if err != nil {
  		return nil, err
  	}
  	plan, err := pr.ReadPlan()
  	if err != nil {
  		return nil, err
  	}
  	return plan, nil
  }
docs: // getPlanFromPath returns a plan if the user-supplied path points to a planfile.
  // If both plan and error are nil, the path is likely a directory.
  // An error could suggest that the given path points to a statefile.