This repository was archived by the owner on Dec 26, 2025. It is now read-only.

Description
package main
import "fmt"
type Transaction struct {
ID int
Status int
}
func main() {
var txns []Transaction
for i := 0; i < 10; i++ {
txns = append(txns, Transaction{ID: i, Status: 0})
}
var ptr []*int
for _, txn := range txns {
fmt.Printf("Transaction ID: %d, Status addr: %p\n", txn.ID, &(txn.Status))
ptr = append(ptr, &(txn.Status))
}
}
running: exportloopref got no error