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

Implement stringer interface for the Query type #451

Merged
merged 3 commits into from Aug 12, 2015

Conversation

Projects
None yet
3 participants
@johnweldon
Contributor

johnweldon commented Aug 7, 2015

To make logging a little nicer in downstream usage.

Implement stringer interface for the Query type
To make logging a little nicer in downstream usage.
@Zariel

This comment has been minimized.

Member

Zariel commented Aug 10, 2015

Hi, thanks for this. It might be worth making this consistent with the other string methods in frame, something like

[query statment=%q values=%+#v consistency=%s]

@johnweldon

This comment has been minimized.

Contributor

johnweldon commented Aug 10, 2015

makes sense - will do
Thanks

@Zariel

This comment has been minimized.

Member

Zariel commented Aug 10, 2015

Also if you are not already could you add yourself to the AUTHORS file, thanks.

session.go Outdated
@@ -434,6 +434,11 @@ type Query struct {
defaultTimestamp bool
}
// String implements the stringer interface.
func (q *Query) String() string {

This comment has been minimized.

@bfontaine

bfontaine Aug 12, 2015

Contributor

Why did you implement it on a pointer receiver?

This comment has been minimized.

@johnweldon

johnweldon Aug 12, 2015

Contributor

Good catch @bfontaine - it was actually a mistake I've made for a few months now. I mis-interpreted Effective Go and have been "doing it wrong" until you asked the question :)

I'll fix this.

@johnweldon

This comment has been minimized.

Contributor

johnweldon commented Aug 12, 2015

Okay @bfontaine and @Zariel - I think this is finally ready to merge :)

Zariel added a commit that referenced this pull request Aug 12, 2015

Merge pull request #451 from johnweldon/master
Implement stringer interface for the Query type

@Zariel Zariel merged commit 9d122d6 into gocql:master Aug 12, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Zariel

This comment has been minimized.

Member

Zariel commented Aug 12, 2015

Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment