From 41d375a73a19c254417c3e6334a0b16be5421bba Mon Sep 17 00:00:00 2001 From: Guillaume Belanger Date: Wed, 3 Jan 2024 15:59:36 -0500 Subject: [PATCH] chore: Enables gofmt linting --- .golangci.yml | 2 +- pcf_test.go | 54 +++++++++++++++++++++++++++------------------------ 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 66b41aa..9fd33f8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -220,7 +220,7 @@ linters-settings: linters: enable: - # - gofmt + - gofmt # - govet # - errcheck # - staticcheck diff --git a/pcf_test.go b/pcf_test.go index 4be9a88..e327ae0 100644 --- a/pcf_test.go +++ b/pcf_test.go @@ -38,9 +38,11 @@ func init() { } } -/*func init() { - factory.InitConfigFactory("amfTest/amfcfg.yaml") -}*/ +/* + func init() { + factory.InitConfigFactory("amfTest/amfcfg.yaml") + } +*/ func GetNetworkSliceConfig() *protos.NetworkSliceResponse { var rsp protos.NetworkSliceResponse rsp.NetworkSlice = make([]*protos.NetworkSlice, 0) @@ -109,28 +111,30 @@ var Data = []byte(`{ } ]}`) -/*func TestUpdateConfig(t *testing.T) { - var nrp protos.NetworkSliceResponse - err := json.Unmarshal(Data, &nrp) - if err != nil { - panic(err) - } - var Rsp chan *protos.NetworkSliceResponse - Rsp = make(chan *protos.NetworkSliceResponse) - go func() { - Rsp <- &nrp - }() - go func() { - AMF.UpdateConfig(Rsp) - }() - time.Sleep(2 * time.Second) - if factory.AmfConfig.Configuration.SupportTAIList != nil && - len(factory.AmfConfig.Configuration.SupportTAIList) == 2 { - fmt.Printf("test passed") - } else { - t.Errorf("test failed") +/* + func TestUpdateConfig(t *testing.T) { + var nrp protos.NetworkSliceResponse + err := json.Unmarshal(Data, &nrp) + if err != nil { + panic(err) + } + var Rsp chan *protos.NetworkSliceResponse + Rsp = make(chan *protos.NetworkSliceResponse) + go func() { + Rsp <- &nrp + }() + go func() { + AMF.UpdateConfig(Rsp) + }() + time.Sleep(2 * time.Second) + if factory.AmfConfig.Configuration.SupportTAIList != nil && + len(factory.AmfConfig.Configuration.SupportTAIList) == 2 { + fmt.Printf("test passed") + } else { + t.Errorf("test failed") + } } -}*/ +*/ func TestUpdatePcfSubsriberPolicyDataAdd(t *testing.T) { var nrp protos.NetworkSliceResponse err := json.Unmarshal(Data, &nrp) @@ -226,7 +230,7 @@ var UData1 = []byte(`{ } ]}`) -//Two imsis deleted and 1 imsi added in device group +// Two imsis deleted and 1 imsi added in device group func TestUpdatePcfSubsriberPolicyDataUpdate1(t *testing.T) { var nrp protos.NetworkSliceResponse err := json.Unmarshal(UData1, &nrp)