DEV Community

Cover image for Golang perk series : structs – pass_by_reference #7 | (pointers-again)
LG
LG

Posted on

Golang perk series : structs – pass_by_reference #7 | (pointers-again)

In earlier we get know with pointers & later structs, now we use both : yes, pointers again , folks !

Before digging into code worth to underline one more time – Golang is pass-by-value language, so pointers enables us to pass-by-reference so modifying original value, struct, etc.

TIP : REPLIT IDE named "structs" was updated with extra couple of files :

  • pass-by-reference--before.go (pass-by-value)

  • pass-by-reference--after.go (pass-by-reference)

NOTE : All explained in the code : refer to comments, pay extra attention at steps 1/2) & 2/2)


Interfaces coming shortly, stay tuned !

Top comments (0)