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

Refactor path for configuration file, option(s) and Docker image #168

Merged
merged 2 commits into from
Nov 2, 2024

Conversation

gab-arrobo
Copy link
Contributor

No description provided.

}
problem := localErr.(openapi.GenericOpenAPIError).Model().(models.ProblemDetails)
problemDetails = &problem
} else {
err = openapi.ReportError("%s: server no response", amfUri)
}

defer func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What benefit we get with this coding style?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to address a linter issue (bodyclose). If you have a better approach, I am more than happy to integrate it into the code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just close it .. does it give performance benefit of creating new goroutine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean something like this?

defer httpResp.Body.Close()

If so, golangci-linter complains with the following error when just using defer httpResp.Body.Close()

consumer/communication.go:56:27: Error return value of `httpResp.Body.Close` is not checked (errcheck)
        defer httpResp.Body.Close()
                                 ^

@thakurajayL thakurajayL merged commit a31ba22 into omec-project:main Nov 2, 2024
9 checks passed
@gab-arrobo gab-arrobo deleted the refactor-configuration branch November 2, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants