dont fail on init for empty reader/path
Some checks failed
codeql / analyze (go) (push) Failing after 49s
build / lint (push) Has been cancelled
build / test (push) Has been cancelled

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-11-19 20:35:06 +03:00
parent 89b41364c3
commit 3cc1cf899a
3 changed files with 32 additions and 15 deletions

View File

@@ -54,13 +54,6 @@ func (c *fileConfig) Init(opts ...config.Option) error {
return fmt.Errorf("Codec must be specified")
}
if c.path == "" && c.reader == nil {
err := fmt.Errorf("Path or Reader must be specified")
if !c.opts.AllowFail {
return err
}
}
if err := config.DefaultAfterInit(c.opts.Context, c); err != nil && !c.opts.AllowFail {
return err
}