Shallow vs Deep Copying in Go

preview_player
Показать описание
Difference between shallow and deep copying in Go.

----
Рекомендации по теме
Комментарии
Автор

What other coding topics would you like to learn about next?

adibhanna
Автор

So another way to think about the original assignment of Person is the "&" tells the compiler you want to set original to a pointer of the struct Person. This is exactly why original values get overwritten. If you remove the "&" from Person during assignment you are creating a new instance of the struct. If you do it this way you will end up having two instances of Person when you create the copy variable. This avoids the need to use deep copy which is processor intensive. The tradeoff is that you will use more memory since you now have two instances of Person instead of a pointer to one.

snoodking
Автор

Thanks for the video

Question: how have you configured your [Neo]vim to show the "special characters" in visual mode but not normal mode? (I means those tabs, spaces, etc.)

farzadmf
Автор

Hi adib can i ask, how you make spaces beetween line on neovim

mornsoltice