def METHOD_NAME(rule_runner: RuleRunner) -> None:
    rule_runner.write_files(
        {
            "f.go": BAD_FILE_TO_SIMPLIFY,
            "go.mod": GO_MOD,
            "BUILD": "go_mod(name='mod')\ngo_package(name='pkg')",
        }
    )
    tgt = rule_runner.get_target(Address("", target_name="pkg"))
    with pytest.raises(ExecutionError, match=SUPPORTED_GOFMT_ARGS_AS_HELP):
        run_gofmt(rule_runner, [tgt], extra_args=["--gofmt-args=-unsupported"])
    fmt_result = run_gofmt(
        rule_runner, [tgt], extra_args=["--gofmt-args=-s"]
    )  # -s flag will simplify the code
    assert fmt_result.stderr == ""
    assert fmt_result.output == rule_runner.make_snapshot({"f.go": FIXED_BAD_FILE_TO_SIMPLIFY})
    assert fmt_result.did_change is True