)]}'
{
  "commit": "63a7b87be32597f03a88cb18e32d5b3413cb38bc",
  "tree": "e0ff73c561afb9cffc054ca13a23eb88834f96a0",
  "parents": [
    "1980517c3e02f13383b6067257082c6d2ddc431c"
  ],
  "author": {
    "name": "Madeline Kalil",
    "email": "mkalil@google.com",
    "time": "Thu Oct 30 14:05:27 2025 -0400"
  },
  "committer": {
    "name": "Madeline Kalil",
    "email": "mkalil@google.com",
    "time": "Fri Oct 31 09:20:19 2025 -0700"
  },
  "message": "go/analysis/passes/modernize: fix illegal byte argument error produced in stringscut modernizer\n\nThis CL fixes a bug in the stringscut modernizer. Previously, an instance of strings.IndexByte(s, \u0027a\u0027) would become strings.Cut(s, \u0027a\u0027) with \u0027a\u0027 being an illegal argument because strings.Cut expects a string, not a byte.\n\nIf we examine an instance of strings.IndexByte and are about to suggest a modernization, we append an additional edit that transforms the byte literal or byte variable substr arg to a string literal.\n\nFor example, the following calls to strings.IndexByte would yield the substr arg:\nstrings.IndexByte(_, \u0027a\u0027) -\u003e strings.Cut(_, \"a\")\n\nstrings.IndexByte(_, 55) -\u003e strings.Cut(_, \"7\")\n\nb :\u003d byte(\u0027a\u0027)\nstrings.IndexByte(_, b) -\u003e strings.Cut(_, string(b))\n\nFor bytes.IndexByte, the second argument must be a converted to a []byte:\n\nbytes.IndexByte(_, \u0027a\u0027) -\u003e bytes.Cut(_, []byte{\u0027a\u0027})\n\nChange-Id: I1a7670e95ebdffca5ce7a2a09a103f1a6fee6db3\nReviewed-on: https://go-review.googlesource.com/c/tools/+/716600\nLUCI-TryBot-Result: Go LUCI \u003cgolang-scoped@luci-project-accounts.iam.gserviceaccount.com\u003e\nReviewed-by: Alan Donovan \u003cadonovan@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "89d5085284d54e648e559d971daeeafa64d8364a",
      "old_mode": 33188,
      "old_path": "go/analysis/passes/modernize/stringscut.go",
      "new_id": "1342965a41ed4a2a5d8046ade3405b2d1e241843",
      "new_mode": 33188,
      "new_path": "go/analysis/passes/modernize/stringscut.go"
    },
    {
      "type": "modify",
      "old_id": "68c1115687e902dc24c8b102914b58d3390fc23a",
      "old_mode": 33188,
      "old_path": "go/analysis/passes/modernize/testdata/src/stringscut/stringscut.go",
      "new_id": "6b9aef1869ffa55cd9576c24ffbdb15efc13a11a",
      "new_mode": 33188,
      "new_path": "go/analysis/passes/modernize/testdata/src/stringscut/stringscut.go"
    },
    {
      "type": "modify",
      "old_id": "cd53fb7fc294308d013a5f5f9ed4d29dd6b4565c",
      "old_mode": 33188,
      "old_path": "go/analysis/passes/modernize/testdata/src/stringscut/stringscut.go.golden",
      "new_id": "75b778e5ff1ad9ba9f7fff24ec0483c1a6b1f6f9",
      "new_mode": 33188,
      "new_path": "go/analysis/passes/modernize/testdata/src/stringscut/stringscut.go.golden"
    }
  ]
}
