Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use pointer receiver for Key#8

Open
Freeaqingme wants to merge 3 commits intoprep:master from
Freeaqingme:master
Open

Use pointer receiver for Key #8
Freeaqingme wants to merge 3 commits intoprep:master from
Freeaqingme:master

Conversation

@Freeaqingme
Copy link
Contributor

@Freeaqingme Freeaqingme commented Dec 28, 2018

While debugging an issue I added the pointer receivers. I'm not sure if that's what made the difference, but it seems a good improvement nonetheless.

Copy link
Owner

prep commented Feb 17, 2019

Hey Dolf,

Apologies for the late reply.

Are you saying this solves a problem you were having, or are just preferring the aesthetics of having the methods on Key be pointer receivers? If it's the latter, I'm not against it per se, but none of those methods change the state of the Key so making them value receivers made more sense to me.

Copy link
Contributor Author

Are you saying this solves a problem you were having

That I'm not sure about anymore :)

Advantages of using pointer receivers is that otherwise the struct would be copied for every method invocation. There was a nice blogpost that I'm thinking of but can't find it right now.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /