util/file: allow context to be passed (#1950)

This commit is contained in:
ben-toogood
2020-08-19 16:03:19 +01:00
committed by GitHub
parent 66df1bb361
commit 81a9342b83
2 changed files with 34 additions and 8 deletions

15
util/file/options.go Normal file
View 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
}
}