def METHOD_NAME():
    platforms = []
    for goos, goarch in GOOS_GOARCH:
        constraints = [
            GOOS_CONSTRAINTS[goos],
            GOARCH_CONSTRAINTS[goarch],
        ]
        platforms.append(struct(
            name = goos + "_" + goarch,
            goos = goos,
            goarch = goarch,
            constraints = constraints + ["@io_bazel_rules_go//go/toolchain:cgo_off"],
            cgo = False,
        ))
        if (goos, goarch) in CGO_GOOS_GOARCH:
            # On Windows, Bazel will pick an MSVC toolchain unless we
            # specifically request mingw or msys.
            mingw = ["@bazel_tools//tools/cpp:mingw"] if goos == "windows" else []
            platforms.append(struct(
                name = goos + "_" + goarch + "_cgo",
                goos = goos,
                goarch = goarch,
                constraints = constraints + ["@io_bazel_rules_go//go/toolchain:cgo_on"] + mingw,
                cgo = True,
            ))
    return platforms