bmatsuo / lmdb-go

Bindings for the LMDB C library
BSD 3-Clause "New" or "Revised" License
157 stars 59 forks source link

lmdbsync: Env should be an argument of HandleTxnErr #52

Closed bmatsuo closed 8 years ago

bmatsuo commented 8 years ago

The docs for golang.org/x/net/context recommend that Context not be used to pass arguments to between functions. The Env is truly and argument for the functions. It is not always used. But it is common enough when you want to use a handler that it deserves inclusion in the arg list.

So the Handler interface should look as follows:

type Handler interface {
    HandleTxnErr(ctx context.Context, env *Env, err error) (context.Context, error)
}