Skip to content

Commit

Permalink
chore: Adds errcheck lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
gruyaume committed Jan 4, 2024
1 parent d871d55 commit ff55837
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ linters:
enable:
- gofmt
- govet
# - errcheck
- errcheck
- staticcheck
- unused
# - gosimple
Expand Down
5 changes: 4 additions & 1 deletion factory/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ func (c *Config) updateConfig(commChannel chan *protos.NetworkSliceResponse, dbU
}

}
c.addSmPolicyInfo(ns, dbUpdateChannel)
err := c.addSmPolicyInfo(ns, dbUpdateChannel)
if err != nil {
logger.GrpcLog.Errorf("Error in adding sm policy info to db %v", err)
}
}
if minConfig == false {
// first slice Created
Expand Down
10 changes: 8 additions & 2 deletions producer/data_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,14 @@ func HandleCreateAccessAndMobilityData(request *http_wrapper.Request) *http_wrap

// seems something which we should move to mongolib
func toBsonM(data interface{}) (ret bson.M) {
tmp, _ := json.Marshal(data)
json.Unmarshal(tmp, &ret)
tmp, err := json.Marshal(data)
if err != nil {
logger.CfgLog.Infoln("marshal fail ", err)
}
err = json.Unmarshal(tmp, &ret)
if err != nil {
logger.CfgLog.Infoln("unmarshal fail ", err)
}
return
}

Expand Down

0 comments on commit ff55837

Please sign in to comment.