To avoid breaking changes (constructor signature and existing behavior), I extended the current constructor with a variadic of functions to add options.
The approach avoids creating a new constructor, like NewWithOptions(path string, opts Options), and breaking the current constructor signature.
To avoid breaking changes (constructor signature and existing behavior), I extended the current constructor with a variadic of functions to add options.
The approach avoids creating a new constructor, like
NewWithOptions(path string, opts Options)
, and breaking the current constructor signature.There are 2 options:
SetFlag
: sets the flag used to create/open the file.SetPermissions
: sets the OS permissions to set on the file.Fixes #59