Methods in Golang | Intermediate level

Published: 19 June 2023
on channel: Sreekanth
2,047
73

Explains how methods work in Go, things like method normalization, method value evaluation, gotchas and best practices. It also explains the reasons for choosing between pointer and value receiver.

0:00 Basics of Methods
1:21 Value vs Pointer receivers
2:55 Methods on nil values
3:44 Pass by copy
5:54 Pass by copy with slices
7:58 Method normalization
9:25 Method value evaluation
11:01 Gotcha - calling method in range loop
12:26 New types won't get methods of base type
12:53 Choosing between pointer and value receiver

Intermediate level Golang playlist:    • Memory layout and mechanics of arrays...  

Dave Cheney's blog posts:
https://dave.cheney.net/2016/03/19/sh...
https://dave.cheney.net/2015/11/18/we...

Code review wiki: https://github.com/golang/go/wiki/Cod...


Watch video Methods in Golang | Intermediate level online, duration hours minute second in high quality that is uploaded to the channel Sreekanth 19 June 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 2,047 times and liked it 73 visitors.