code: func flattenErrors(err error) error {
  	var ret errors.MultiError
  	flattenErrorsRec(&ret, err)
  	if len(ret) == 0 {
  		return nil
  	}
  	return ret
  }
docs: ////////////////////////////////////////////////////////////////////////////////
  // flattenErrors collapses a multi-dimensional MultiError space into a flat
  // MultiError, removing "nil" errors.
  //
  // If err is not an errors.MultiError, will return err directly.
  //
  // As a special case, if merr contains no non-nil errors, nil will be returned.