config: improve and export helper func

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-12-19 23:22:05 +03:00
parent 035a84e696
commit 150e8ad698
4 changed files with 44 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ type Cfg struct {
func TestDefault(t *testing.T) {
ctx := context.Background()
conf := &Cfg{}
conf := &Cfg{IntValue: 10}
blfn := func(ctx context.Context, cfg config.Config) error {
conf, ok := cfg.Options().Struct.(*Cfg)
if !ok {