Skip to content

Commit

Permalink
chore: Adds staticcheck lint check (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
gruyaume authored Jan 4, 2024
1 parent 6371cd6 commit deab294
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ linters:
- gofmt
# - govet
# - errcheck
# - staticcheck
- staticcheck
- unused
# - gosimple
# - ineffassign
Expand Down
4 changes: 2 additions & 2 deletions factory/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package factory

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

"gopkg.in/yaml.v2"

Expand All @@ -22,7 +22,7 @@ var PcfConfig Config

// 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 {
PcfConfig = Config{}
Expand Down
2 changes: 1 addition & 1 deletion producer/smpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func createSMPolicyProcedure(request models.SmPolicyContextData) (
sstStr := strconv.Itoa(int(request.SliceInfo.Sst))
sliceid := sstStr + request.SliceInfo.Sd
self := pcf_context.PCF_Self()
imsi := strings.Trim(ue.Supi, "imsi-")
imsi := strings.TrimPrefix(ue.Supi, "imsi-")
if subsPolicyData, ok := self.PcfSubscriberPolicyData[imsi]; ok {
logger.SMpolicylog.Infof("Supi[%s] exist in PcfSubscriberPolicyData", imsi)
if PccPolicy, ok1 := subsPolicyData.PccPolicy[sliceid]; ok1 {
Expand Down
6 changes: 6 additions & 0 deletions service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,16 @@ func (pcf *PCF) UpdateNF() {
problemDetails.Status == 404 || problemDetails.Status == 400 {
//register with NRF full profile
nfProfile, err = pcf.BuildAndSendRegisterNFInstance()
if err != nil {
initLog.Errorf("PCF register to NRF Error[%s]", err.Error())
}
}
} else if err != nil {
initLog.Errorf("PCF update to NRF Error[%s]", err.Error())
nfProfile, err = pcf.BuildAndSendRegisterNFInstance()
if err != nil {
initLog.Errorf("PCF register to NRF Error[%s]", err.Error())
}
}

if nfProfile.HeartBeatTimer != 0 {
Expand Down

0 comments on commit deab294

Please sign in to comment.