Skip to content

Commit

Permalink
chore: Adds staticcheck and unused lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
gruyaume committed Jan 4, 2024
1 parent 9bb591e commit 6d31e0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ linters:
- gofmt
- govet
# - errcheck
# - staticcheck
# - unused
- staticcheck
- unused
# - gosimple
- ineffassign
- typecheck
Expand Down
3 changes: 1 addition & 2 deletions factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ package factory

import (
"fmt"
"io/ioutil"
"os"

"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -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{}
Expand Down
9 changes: 7 additions & 2 deletions service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ type UDR struct{}
type (
// Config information.
Config struct {
udrcfg string
heartBeatTimer string
udrcfg string
}
)

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6d31e0f

Please sign in to comment.