packagestm// Retry is a sentinel value. When thrown via panic, it indicates that a// transaction should be retried.constRetry="retry"// catchRetry returns true if fn calls tx.Retry.funccatchRetry(fnfunc(*Tx),tx*Tx)(retrybool){deferfunc(){ifr:=recover();r==Retry{retry=true}elseifr!=nil{panic(r)}}()fn(tx)return}