util/file: allow context to be passed (#1950)
This commit is contained in:
15
util/file/options.go
Normal file
15
util/file/options.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package file
|
||||
|
||||
import "context"
|
||||
|
||||
type Options struct {
|
||||
Context context.Context
|
||||
}
|
||||
|
||||
type Option func(o *Options)
|
||||
|
||||
func WithContext(ctx context.Context) Option {
|
||||
return func(o *Options) {
|
||||
o.Context = ctx
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user