methods with non-pointer as receiver #13

Closed
wangii opened this Issue Feb 19, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@wangii

wangii commented Feb 19, 2014

Is there any reason why methods signature in this library are like:
func (q Queue) ListQueues(page, perPage int)
instead of:
func (q *Queue) ListQueues(page, perPage int)
as widely used in golang world?

@treeder

This comment has been minimized.

Show comment
Hide comment
@treeder

treeder Feb 19, 2014

Contributor

No, they probably should be the way you specify. Pull requests welcome. ;)

Contributor

treeder commented Feb 19, 2014

No, they probably should be the way you specify. Pull requests welcome. ;)

@wangii

This comment has been minimized.

Show comment
Hide comment
@wangii

wangii Feb 20, 2014

there is a performance penalty to use value instead of pointer as receiver. see http://golang.org/doc/faq#pass_by_value
i'd suggest to check iron.io's internal golang code base. a fix on client side sdk brings comparatively low value but high cost.

wangii commented Feb 20, 2014

there is a performance penalty to use value instead of pointer as receiver. see http://golang.org/doc/faq#pass_by_value
i'd suggest to check iron.io's internal golang code base. a fix on client side sdk brings comparatively low value but high cost.

@nikhilm

This comment has been minimized.

Show comment
Hide comment
@nikhilm

nikhilm Oct 29, 2015

@treeder it looks like this can be closed.

nikhilm commented Oct 29, 2015

@treeder it looks like this can be closed.

@treeder treeder closed this Nov 2, 2015

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