)]}'
{
  "commit": "dcf3422456db7e8e760db511150f9491183de2d7",
  "tree": "0e2dcfc9be588b89deea105711863c8f904311c3",
  "parents": [
    "89e1a1652a55e66e82f45f0fb604375fc468fad1"
  ],
  "author": {
    "name": "nnnkkk7",
    "email": "kurodanaoki0711pana@gmail.com",
    "time": "Thu Oct 01 19:52:51 2026 +0900"
  },
  "committer": {
    "name": "Alex Putman",
    "email": "aputman@golang.org",
    "time": "Wed Oct 07 08:29:24 2026 -0700"
  },
  "message": "go/analysis/passes/modernize: slicesbackward - skip slice expressions with side effects\n\nThe slicesbackward analyzer moves the slice expression into the range\nheader, where it is evaluated once, whereas the original loop evaluates\nit in the header and again in each s[i] in the body. If the expression\nhas side effects, such as a function call, the fix changes how many\ntimes they occur. For\n\n\tfor i :\u003d len(next()) - 1; i \u003e\u003d 0; i-- {\n\t\tprintln(next()[i])\n\t}\n\nthe offered fix\n\n\tfor _, v :\u003d range slices.Backward(next()) {\n\t\tprintln(v)\n\t}\n\ncalls next once instead of three times.\n\nSkip the loop when the body indexes a slice expression with side\neffects, as slicessort and slicescontains do for theirs. A body that\nnever indexes it still evaluates it once, so the fix remains safe there.\n\nFixes golang/go#81937\n\nChange-Id: I35db0054192b2e9dd64bb6eec9948e0d9c7eec2c\nReviewed-on: https://go-review.googlesource.com/c/tools/+/842865\nLUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com \u003cgolang-scoped@luci-project-accounts.iam.gserviceaccount.com\u003e\nReviewed-by: Alex Putman \u003caputman@golang.org\u003e\nReviewed-by: Madeline Kalil \u003cmkalil@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b2e3623ca72a64cfb33fd87abddade2989cfc09f",
      "old_mode": 33188,
      "old_path": "go/analysis/passes/modernize/slicesbackward.go",
      "new_id": "47c2198261140e9eb2f02293e191e4f4f70ffae6",
      "new_mode": 33188,
      "new_path": "go/analysis/passes/modernize/slicesbackward.go"
    },
    {
      "type": "modify",
      "old_id": "51b55a32fc0ddbf24c8167fa888ac08d556e8dc4",
      "old_mode": 33188,
      "old_path": "go/analysis/passes/modernize/testdata/src/slicesbackward/slicesbackward.go",
      "new_id": "c8fb3ea4435958d8dc815543b16480c3e29b15e7",
      "new_mode": 33188,
      "new_path": "go/analysis/passes/modernize/testdata/src/slicesbackward/slicesbackward.go"
    },
    {
      "type": "modify",
      "old_id": "3e673d8d6d82a14a6737c5d9a523c3f9bdb587b1",
      "old_mode": 33188,
      "old_path": "go/analysis/passes/modernize/testdata/src/slicesbackward/slicesbackward.go.golden",
      "new_id": "cc0fca42fdbb2fcf0d1c5a8b2ea641b31c9acc1b",
      "new_mode": 33188,
      "new_path": "go/analysis/passes/modernize/testdata/src/slicesbackward/slicesbackward.go.golden"
    }
  ]
}
