def read_go_deps(main_packages, build_tags):
    '\n    read_go_deps returns a list of module dependencies in JSON format.\n    Main modules are excluded; only dependencies are returned.\n\n    Unlike `go list -m all`, this function excludes modules that are only\n    required for running tests.\n    '
    go_list_args = ['go', 'list', '-deps', '-json']
    if build_tags:
        go_list_args.extend(['-tags', build_tags])
    output = subprocess.check_output((go_list_args + main_packages)).decode('utf-8')
    modules = {}
    decoder = json.JSONDecoder()
    while True:
        output = output.strip()
        if (not output):
            break
        (pkg, end) = decoder.raw_decode(output)
        output = output[end:]
        if ('Standard' in pkg):
            continue
        module = pkg['Module']
        if ('Main' not in module):
            modules[module['Path']] = module
    return sorted(modules.values(), key=(lambda module: module['Path']))
read_go_deps returns a list of module dependencies in JSON format.
Main modules are excluded; only dependencies are returned.

Unlike `go list -m all`, this function excludes modules that are only
required for running tests.
def read_go_deps(main_packages, build_tags):
    '\n    read_go_deps returns a list of module dependencies in JSON format.\n    Main modules are excluded; only dependencies are returned.\n\n    Unlike `go list -m all`, this function excludes modules that are only\n    required for running tests.\n    '
    go_list_args = ['go', 'list', '-deps', '-json']
    if build_tags:
        go_list_args.extend(['-tags', build_tags])
    output = subprocess.check_output((go_list_args + main_packages)).decode('utf-8')
    modules = {}
    decoder = json.JSONDecoder()
    while True:
        output = output.strip()
        if (not output):
            break
        (pkg, end) = decoder.raw_decode(output)
        output = output[end:]
        if ('Standard' in pkg):
            continue
        module = pkg['Module']
        if ('Main' not in module):
            modules[module['Path']] = module
    return sorted(modules.values(), key=(lambda module: module['Path']))