When to use Pointers in Go w/ Practical Example - Heap/Stack, Pointer Receiver

  Рет қаралды 2,740

david hwang

david hwang

Күн бұрын

Skip to 5:18 for the code. Timestamp is available in the comment section below.
Understanding Allocations: the Stack and the Heap by Jacob Walker - GopherCon SG 2019:
• Understanding Allocati...
When to use pointers in Go by Dylan Meeus:
/ when-to-use-pointers-i...
Go doc on Pointer Receiver:
go.dev/doc/faq#methods_on_val...

Пікірлер: 8
@dhij
@dhij 2 жыл бұрын
0:00 Intro - Stack & Heap; How it is different in Golang 0:30 Common idea of pointers; Why passing pointers in Go is often slower than passing values 1:13 Understanding Allocations: the Stack & the Heap (GopherCon presentation by Jacob Walker) 2:00 How Go typically stores variables in the stack vs. heap 3:10 Visualization of stack - a scenario where stack will not work 4:02 Summary of Understanding Allocations 4:48 4 different use cases of pointers in Go 5:18 Overview of code example 6:39 An example of "sharing up" the pointer to the User struct (stored in the heap) 7:56 Case 2 & 3: Mutability of the receiver function & Consistency 9:21 Case 4: Signify true absence (make a nullable variable)
@antonjatula8421
@antonjatula8421 Жыл бұрын
Thank you for making this video :) Superbly explained and insightful examples!
@dhij
@dhij Жыл бұрын
Appreciate it!!
@apidas
@apidas Жыл бұрын
great video. appreciate the sharing
@dhij
@dhij Жыл бұрын
Appreciate it!
@thanhduongphan315
@thanhduongphan315 11 ай бұрын
Thank you for explaining !!!
@VIKTOR-pw8eu
@VIKTOR-pw8eu Жыл бұрын
Came to your channel after watching your chat app tutorial (btw tutorial is awesome). This video is so much useful and it helped me understand your architecture approach. Thank you so much and keep it up!
@dhij
@dhij Жыл бұрын
Glad that helped!!
Go Pointers: When & How To Use Them Efficiently
14:09
Anthony GG
Рет қаралды 70 М.
When You Should Actually Use Pointers In Go
16:34
Bryan English
Рет қаралды 15 М.
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 12 МЛН
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 69 МЛН
Understanding Allocations: the Stack and the Heap - GopherCon SG 2019
21:39
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 289 М.
The size of your variables matters.
11:03
Core Dumped
Рет қаралды 104 М.
Mastering Inheritance By Struct Embedding In Golang
13:05
Anthony GG
Рет қаралды 29 М.
Секреты внутреннего устройства планировщика Go
1:01:57
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,1 МЛН
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel
Рет қаралды 120 М.