)]}'
{
  "commit": "9ca4797bbca6f785febcff7bc1508c83110a5de8",
  "tree": "ab1103fc64cb0b4138995d01ae4b161184283509",
  "parents": [
    "c80ebd13ddc794884bfd2fe68fcfda646e905bf1"
  ],
  "author": {
    "name": "Régis Desgroppes",
    "email": "rdesgroppes@gmail.com",
    "time": "Wed Feb 11 20:37:53 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Feb 11 20:37:53 2026 +0100"
  },
  "message": "Also allow to read the SDK version from `go.work` (#4555)\n\n**What type of PR is this?**\n\nFeature\n\n**What does this PR do? Why is it needed?**\n\nExtends `go_sdk.from_file` (#4305) to accept a `go_work` attribute\nalongside the existing `go_mod` attribute. This allows modules to read\ntheir SDK version from a `go.work` file, providing better integration\nfor workspace-based Go projects and maintaining consistency with the\nexisting `go.mod` support.\n\nVersion extraction follows the same rules as `go.mod`: the `toolchain`\ndirective takes precedence over the `go` directive.\n\n**Which issues(s) does this PR fix?**\n\nFixes #4554.\n\n**Other notes for review**\n\nWhen the go line is omitted, `go.mod` has an implicit `go 1.16` line\nwhile `go.work` has an implicit `go 1.18` line, as per the Go toolchain\ndocumentation at https://go.dev/doc/toolchain#config.\n\nThe implementation reuses the existing parser by extracting common logic\ninto a shared `_version_from_go_file` function that both\n`version_from_go_mod` and the new `version_from_go_work` call with\ndifferent default versions.\n\nTests follow the same pattern as `from_go_mod_file_test`, covering\ntoolchain precedence, minor version support, go-only directive, and\nmissing directives.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c6ef23909dde7bcaccecc18f68b22c6d79d244a6",
      "old_mode": 33188,
      "old_path": ".bazelci/presubmit.yml",
      "new_id": "f2012db96d16f348fc069e4f796c4e88a1b40607",
      "new_mode": 33188,
      "new_path": ".bazelci/presubmit.yml"
    },
    {
      "type": "modify",
      "old_id": "1d94b2e70466dc456d5e170d29b6c60f3c03a52f",
      "old_mode": 33188,
      "old_path": "docs/go/core/bzlmod.md",
      "new_id": "c15d7644f3a81de0b8d67ccdefe2baed86af2839",
      "new_mode": 33188,
      "new_path": "docs/go/core/bzlmod.md"
    },
    {
      "type": "modify",
      "old_id": "5dccc87174aee3270c659365db524cf06bb9e915",
      "old_mode": 33188,
      "old_path": "go/private/extensions.bzl",
      "new_id": "90499c361d3542f6b0f120b0dcb2aa4442ad25e3",
      "new_mode": 33188,
      "new_path": "go/private/extensions.bzl"
    },
    {
      "type": "modify",
      "old_id": "ecd3a2e3464853dcf0992913a137106d59ea6e2b",
      "old_mode": 33188,
      "old_path": "go/private/go_mod.bzl",
      "new_id": "e09447f684cffda22e04bf0b3deb6fef030a6b0a",
      "new_mode": 33188,
      "new_path": "go/private/go_mod.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "50f62f8a23dab9d44817a4fec42a902477697d65",
      "new_mode": 33188,
      "new_path": "tests/core/from_go_work_file/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8ef93ce4003bc90f22fc9e8c15792cc2aeff7e5a",
      "new_mode": 33188,
      "new_path": "tests/core/from_go_work_file/README.rst"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "03e93564fef681371e333cd0cf11c98d98ceaa26",
      "new_mode": 33188,
      "new_path": "tests/core/from_go_work_file/from_go_work_file_test.go"
    }
  ]
}
