From 4aae1cdcb10e6ee277763c1220fceb16596a06fb Mon Sep 17 00:00:00 2001 From: porosnicuadrian Date: Tue, 17 Aug 2021 16:50:06 +0300 Subject: [PATCH] Fixed indetation --- apier/v1/apier2_it_test.go | 5 ++--- apier/v1/apier_it_test.go | 5 ++--- utils/dataconverter_test.go | 7 +++++++ utils/struct.go | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/apier/v1/apier2_it_test.go b/apier/v1/apier2_it_test.go index 455dd6778..1288b4695 100644 --- a/apier/v1/apier2_it_test.go +++ b/apier/v1/apier2_it_test.go @@ -116,7 +116,7 @@ func testAPIerResetStorDb(t *testing.T) { // Start CGR Engine func testAPIerStartEngineSleep(t *testing.T) { - time.Sleep(500*time.Millisecond) + time.Sleep(500 * time.Millisecond) if _, err := engine.StopStartEngine(apierCfgPath, *waitRater); err != nil { t.Fatal(err) } @@ -363,7 +363,7 @@ func testApierSetAndRemoveRatingProfileAnySubject(t *testing.T) { Id: "*out:cgrates.org:sms:*any", RatingPlanActivations: engine.RatingPlanActivations{ { - ActivationTime: time.Date(2014, 1, 14, 0, 0, 0,0, time.UTC), + ActivationTime: time.Date(2014, 1, 14, 0, 0, 0, 0, time.UTC), RatingPlanId: "RP_SMS", }, }, @@ -393,7 +393,6 @@ func testApierSetAndRemoveRatingProfileAnySubject(t *testing.T) { } } - func testAPIerKillEngine(t *testing.T) { if err := engine.KillEngine(*waitRater); err != nil { t.Error(err) diff --git a/apier/v1/apier_it_test.go b/apier/v1/apier_it_test.go index 248d2f7db..7a89885c2 100644 --- a/apier/v1/apier_it_test.go +++ b/apier/v1/apier_it_test.go @@ -2077,13 +2077,12 @@ func testApierStopEngine(t *testing.T) { func TestAttrRemoveRatingProfileGetID(t *testing.T) { attr := &AttrRemoveRatingProfile{ - Tenant: "cgrates.org", + Tenant: "cgrates.org", Category: "sms", - Subject: "*any", + Subject: "*any", } expRes := "*out:cgrates.org:sms:*any" if rply := attr.GetId(); rply != expRes { t.Errorf("Expected %+v, received %v", expRes, rply) } } - diff --git a/utils/dataconverter_test.go b/utils/dataconverter_test.go index b7dd8a699..d399d0d6f 100644 --- a/utils/dataconverter_test.go +++ b/utils/dataconverter_test.go @@ -286,6 +286,13 @@ func TestMultiplyConverterConvert(t *testing.T) { } else if !reflect.DeepEqual(rcv, 0.0) { t.Errorf("Expected %+v received: %+v", 0, rcv) } + + m.Value = 2 + if rcv, err := m.Convert(3); err != nil { + t.Error(err) + } else if !reflect.DeepEqual(rcv, 6.0) { + t.Errorf("Expected %+v received: %+v", 0, rcv) + } } func TestNewDivideConverter(t *testing.T) { diff --git a/utils/struct.go b/utils/struct.go index b87eb8551..d5cb9d04a 100644 --- a/utils/struct.go +++ b/utils/struct.go @@ -60,7 +60,7 @@ func MissingStructFields(s interface{}, mandatories []string) []string { sType := sValue.Type() for _, fieldName := range mandatories { fldStr, ok := sType.FieldByName(fieldName) - if !ok || fieldByIndexIsEmpty(sValue, fldStr.Index){ + if !ok || fieldByIndexIsEmpty(sValue, fldStr.Index) { missing = append(missing, fieldName) } }