Skip to content

jborlum/go-further-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Deep-dive in recievers and interface types.

Over the last week I've had several discussions with people regarding receiver types, pointers, and especially the way they work with interface. So I took some time to investigate how they work, and I wanted to share my findings with you guys.

While learning Go I've several times encountered being unable to using pointer receivers if used in collaboration with interface. Coming from C++ this really puzzled me. However when looking into how method expressions and method values work in Go it finally starts making sense. Unlike my previous assumptions it is very much possible to use pointer receivers with interfaces. It just requires the correct syntax.

Hopefully you will find this useful as a reference.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages