From 969ef4b75446157d8346b9e10f507a925440c4da Mon Sep 17 00:00:00 2001 From: gezimbll Date: Thu, 26 Oct 2023 05:26:19 -0400 Subject: [PATCH] Make go vet pass --- .github/workflows/build.yaml | 1 - engine/model_helpers_test.go | 16 ++++++++-------- engine/thresholds.go | 6 +++--- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index abcae9698..f8d46eaec 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -40,7 +40,6 @@ jobs: run: gofmt -s -w . && git diff --exit-code - name: Go Vet - continue-on-error: true # option will soon be removed run: go vet ./... - name: Go Tidy diff --git a/engine/model_helpers_test.go b/engine/model_helpers_test.go index bd302cf1e..f04070417 100644 --- a/engine/model_helpers_test.go +++ b/engine/model_helpers_test.go @@ -4465,8 +4465,8 @@ func TestModelHelperCsvLoadError(t *testing.T) { type testStruct struct { Id int64 Tpid string - Tag string `index:"cat" re:"\w+\s*,\s*"` - Prefix string `index:"1" re:"\+?\d+.?\d*"` + Tag string `index:"cat" re:".*"` + Prefix string `index:"1" re:".*"` CreatedAt time.Time } var testStruct1 testStruct @@ -4481,7 +4481,7 @@ func TestModelHelperCsvLoadError2(t *testing.T) { Id int64 Tpid string Tag string `index:"0" re:"cat"` - Prefix string `index:"1" re:"\+?\d+.?\d*"` + Prefix string `index:"1" re:".*"` CreatedAt time.Time } var testStruct1 testStruct @@ -4496,8 +4496,8 @@ func TestModelHelpersCsvDumpError(t *testing.T) { type testStruct struct { Id int64 Tpid string - Tag string `index:"cat" re:"\w+\s*,\s*"` - Prefix string `index:"1" re:"\+?\d+.?\d*"` + Tag string `index:"cat" re:".*"` + Prefix string `index:"1" re:".*"` CreatedAt time.Time } var testStruct1 testStruct @@ -5907,7 +5907,7 @@ func TestModelHelpersCSVLoadErrorInt(t *testing.T) { type testStruct struct { Id int64 Tpid string - Tag int `index:"0" re:"\w+\s*,\s*"` + Tag int `index:"0" re:".*"` CreatedAt time.Time } @@ -5921,7 +5921,7 @@ func TestModelHelpersCSVLoadErrorFloat64(t *testing.T) { type testStruct struct { Id int64 Tpid string - Tag float64 `index:"0" re:"\w+\s*,\s*"` + Tag float64 `index:"0" re:".*"` CreatedAt time.Time } @@ -5935,7 +5935,7 @@ func TestModelHelpersCSVLoadErrorBool(t *testing.T) { type testStruct struct { Id int64 Tpid string - Tag bool `index:"0" re:"\w+\s*,\s*"` + Tag bool `index:"0" re:".*"` CreatedAt time.Time } diff --git a/engine/thresholds.go b/engine/thresholds.go index 7c306b733..5e2773629 100644 --- a/engine/thresholds.go +++ b/engine/thresholds.go @@ -175,11 +175,11 @@ func (t *Threshold) ProcessEvent(args *utils.CGREvent, dm *DataManager, fltrS *F at.accountIDs = utils.NewStringMap(tntAcnt) } if t.tPrfl.Async { - go func() { + go func(setID string) { if errExec := at.Execute(fltrS); errExec != nil { - utils.Logger.Warning(fmt.Sprintf(" failed executing actions: %s, error: %s", actionSetID, errExec.Error())) + utils.Logger.Warning(fmt.Sprintf(" failed executing actions: %s, error: %s", setID, errExec.Error())) } - }() + }(actionSetID) } else if errExec := at.Execute(fltrS); errExec != nil { utils.Logger.Warning(fmt.Sprintf(" failed executing actions: %s, error: %s", actionSetID, errExec.Error())) err = utils.ErrPartiallyExecuted