diff --git a/.golangci.yml b/.golangci.yml index 2c9cdcf..073d129 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -221,8 +221,8 @@ linters: - gofmt - govet # - errcheck - # - staticcheck - # - unused + - staticcheck + - unused # - gosimple - ineffassign - typecheck diff --git a/factory/factory.go b/factory/factory.go index a8a0f15..500b2ac 100644 --- a/factory/factory.go +++ b/factory/factory.go @@ -12,7 +12,6 @@ package factory import ( "fmt" - "io/ioutil" "os" "gopkg.in/yaml.v2" @@ -43,7 +42,7 @@ func init() { // TODO: Support configuration update from REST api func InitConfigFactory(f string) error { - if content, err := ioutil.ReadFile(f); err != nil { + if content, err := os.ReadFile(f); err != nil { return err } else { UdrConfig = Config{} diff --git a/service/init.go b/service/init.go index aa616d8..cb6453f 100644 --- a/service/init.go +++ b/service/init.go @@ -42,8 +42,7 @@ type UDR struct{} type ( // Config information. Config struct { - udrcfg string - heartBeatTimer string + udrcfg string } ) @@ -366,10 +365,16 @@ func (udr *UDR) UpdateNF() { problemDetails.Status == 404 || problemDetails.Status == 400 { //register with NRF full profile nfProfile, err = udr.BuildAndSendRegisterNFInstance() + if err != nil { + initLog.Errorf("UDR register to NRF Error[%s]", err.Error()) + } } } else if err != nil { initLog.Errorf("UDR update to NRF Error[%s]", err.Error()) nfProfile, err = udr.BuildAndSendRegisterNFInstance() + if err != nil { + initLog.Errorf("UDR register to NRF Error[%s]", err.Error()) + } } if nfProfile.HeartBeatTimer != 0 {