<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def chk_goids(goids, msg=None, raise_except=True):
 """check that all GO IDs have the proper format."""

    for goid in goids:
        if not goid_is_valid(goid):
            if raise_except:
                raise RuntimeError("BAD GO({GO}): {MSG}".format(GO=goid, MSG=msg))
            else:
                return goid