Tagged in

Programming Languages

golangspec
golangspec
A series dedicated to deeply understand Go’s specification and language’s nuances
More information
Followers
6.7K
Elsewhere
More, on Medium

range clause and the address of iteration variable

(source code)

package main
import (
"fmt"
)
type T struct {
id int
}
func main() {
t1 := T{id: 1}
t2 := T{id: 2}
ts1 :=…