From 0d55328946802401086fbd30c045c3ddac6ce060 Mon Sep 17 00:00:00 2001 From: Dmitry Shalashov Date: Mon, 1 Aug 2022 21:20:11 +0300 Subject: [PATCH] fix: applied better fix for PR #46 --- goworker.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/goworker.go b/goworker.go index 66fc1c3..3d918d6 100644 --- a/goworker.go +++ b/goworker.go @@ -42,8 +42,11 @@ type WorkerSettings struct { } func SetSettings(settings WorkerSettings) { - // force the flags to be parsed first before setting the configs. - _ = Init() + // force the flags to be parsed first before setting the configs, so + // they won't overwrite the settings + if err := flags(); err != nil { + panic(fmt.Errorf("can't SetSettings because of %w", err)) + } workerSettings = settings }