You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 26, 2025. It is now read-only.
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))
}
}