def cond_do(dofunc, goargs, restargs=None, condition=True):
    """
    Do a function, check a condition, then do same function but swap first argument.

    :param dofunc: Function to do.
    :type dofunc: function

    :param goargs: List of variable arguments.
    :type goargs: list(str)

    :param restargs: Rest of arguments, which are constant.
    :type restargs: list(str)

    :param condition: Condition to check in order to use secondarg.
    :type condition: bool
    """
    restargs = [] if restargs is None else restargs
    dofunc(goargs[0], *restargs)
    if condition:
        dofunc(goargs[1], *restargs)
