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

Introduce SpanComplete instead SpanError&SpanSuccess #132

Merged
merged 10 commits into from Jan 16, 2020
Merged

Introduce SpanComplete instead SpanError&SpanSuccess #132

merged 10 commits into from Jan 16, 2020

Conversation

ardaguclu
Copy link

@ardaguclu ardaguclu commented Jan 10, 2020

Which problem is this PR solving?

Resolves #123

Short description of the changes

As mentioned in the issue referenced, SpanSuccess and SpanError are used seperately. Instead using these, introducing SpanComplete makes code simpler. This PR is the change of this refactoring.

async/amqp/amqp.go Outdated Show resolved Hide resolved
Copy link

@mantzas mantzas left a comment

Choose a reason for hiding this comment

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

Hi, I have just marked a few defer that are unneeded, but there is not for defers at all. It has a performance cost and no gain at all.

trace/amqp/amqp.go Outdated Show resolved Hide resolved
trace/sns/publisher.go Outdated Show resolved Hide resolved
trace/sql/sql.go Outdated Show resolved Hide resolved
trace/sql/sql.go Outdated Show resolved Hide resolved
Copy link

@mantzas mantzas left a comment

Choose a reason for hiding this comment

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

Hi, like mentioned before defer is usually used to cleanup resources(file close) or handle panics with recover.
I have added two suggestions which makes the code much simple should be fixed.
The same pattern applies to all the rest of the code and should be applied ther as well.

trace/sql/sql.go Outdated Show resolved Hide resolved
trace/sql/sql.go Outdated Show resolved Hide resolved
@mantzas mantzas self-requested a review January 12, 2020 15:34
@mantzas mantzas merged commit 548594e into beatlabs:master Jan 16, 2020
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.

Introduce trace.SpanComplete(sp,err)
3 participants