allow to pass additional options

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2022-04-01 15:24:56 +03:00
parent bac916794d
commit 4b7541ebaa
3 changed files with 69 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package flag
import (
"context"
"flag"
"os"
"testing"
"time"
@@ -40,7 +41,7 @@ func TestLoad(t *testing.T) {
ctx := context.Background()
cfg := &Config{Nested: &NestedConfig{}}
c := NewConfig(config.Struct(cfg), TimeFormat(time.RFC822))
c := NewConfig(config.Struct(cfg), TimeFormat(time.RFC822), FlagErrorHandling(flag.ContinueOnError))
if err := c.Init(); err != nil {
t.Fatalf("init failed: %v", err)
}