diff options
author | Matt Joiner <anacrolix@gmail.com> | 2022-06-14 08:59:02 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 08:59:02 +1000 |
commit | 4f6e80b7bb8c9a8b3036e54b6d02dcc66a690162 (patch) | |
tree | b4810cadfd0ce4a21963ccac5a051e9a50a91f4f /retry.go | |
parent | Bump test timeout (#3) (diff) | |
parent | replace "interface{}" with "any" (diff) | |
download | stm-4f6e80b7bb8c9a8b3036e54b6d02dcc66a690162.tar.gz stm-4f6e80b7bb8c9a8b3036e54b6d02dcc66a690162.tar.xz |
Merge pull request #4 from chrismwendt/generics
Generics
Diffstat (limited to 'retry.go')
-rw-r--r-- | retry.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -11,7 +11,7 @@ var retries = pprof.NewProfile("stmRetries") var retry = &struct{}{} // catchRetry returns true if fn calls tx.Retry. -func catchRetry(fn Operation, tx *Tx) (result interface{}, gotRetry bool) { +func catchRetry[R any](fn Operation[R], tx *Tx) (result R, gotRetry bool) { defer func() { if r := recover(); r == retry { gotRetry = true |