def check_dir_slash(path):
    """Appends trailing slash to path if necessary.

    Args:
      path(str): path to be checked for slash

    Returns:
      (str) path with slash at the end

    """
    if path.endswith('/'):
        return path
    else:
        return path+'/'