import re


def remove_type_spaces(part):
    """
    Trims whitespace from types that can have it. This will alter types, so the resulting strings shoudln't be used to deduce types. The results are intended to make it easier to parse out param names.
    """
    ret = re.sub(r"func\(.*\)\s+", "func()_", part)
    ret = re.sub(r"chan\s+", "chan_", ret)
    return ret