Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Adds errcheck lint check #42

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading