You are right. It was a layer 8 error :-)

Stephen Illingworth schrieb am Montag, 16. Februar 2026 um 18:06:04 UTC+1:

> I just tried it here with go1.26.0. "go fix" treats both examples as I 
> would expect. ie. the first example is converted and the second example is 
> not.
>
> first example:
>
> for row := 0; row < N; row++ {
> for col := 0; col < N; col++ {
> for qrow := 0; qrow < N; qrow++ {
> for qcol := 0; qcol < N; qcol++ {
> }
> }
> }
> }
>
> is converted to:
>
> for range N {
> for range N {
> for range N {
> for range N {
> }
> }
> }
> }
>
> second example:
>
> for row := 1; row < N; row++ {
> for col := 2; col < N; col++ {
> for qrow := 3; qrow < N; qrow++ {
> for qcol := 4; qcol < N; qcol++ {
> }
> }
> }
> }
>
> is not converted.
> On Monday, 16 February 2026 at 16:58:03 UTC Reinhard Wobst wrote:
>
>> P.S.: I used go 1.26.0
>>
>> Reinhard Wobst schrieb am Montag, 16. Februar 2026 um 17:54:56 UTC+1:
>>
>>> To a program with
>>>
>>> for row := 0; row < N; row++ {
>>>         for col := 0; col < N; col++ {
>>>                 for qrow := 0; qrow < N; qrow++ {
>>>                         for qcol := 0; qcol < N; qcol++ {
>>>
>>> I applied "go fix" and correctly got
>>>
>>> for row := range N {
>>>         for col := range N {
>>>                 for qrow := range N {
>>>                         for qcol := range N {
>>>
>>> Very nice. But when I modified it to
>>>
>>> for row := 1; row < N; row++ { 
>>>       for col := 2; col < N; col++ { 
>>>           for qrow := 3; qrow < N; qrow++ { 
>>>               for qcol := 4; qcol < N; qcol++ {
>>>
>>> I got the same output what is obviously wrong.
>>> Did I overlook something trivial?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/5f656017-142f-4693-baa5-0e4febb37ff5n%40googlegroups.com.

Reply via email to