EASY_GOLANG_TESTS Telegram 1616
🤔 Какое поведение по умолчанию используется в Go при передаче в функцию?

В Go параметры по умолчанию передаются по значению. Это значит, что функция получает копию переменной, и любые изменения внутри функции не повлияют на оригинал.
Однако:
- Если передаётся указатель (*T), слайс, карта или канал, то содержимое может быть изменено.
- Структуры копируются целиком, если не передаются по указателю.


Ставь 👍 если знал ответ, 🔥 если нет
Забирай 📚Базу Знаний
Please open Telegram to view this post
VIEW IN TELEGRAM
👍4



tgoop.com/easy_golang_tests/1616
Create:
Last Update:

🤔 Какое поведение по умолчанию используется в Go при передаче в функцию?

В Go параметры по умолчанию передаются по значению. Это значит, что функция получает копию переменной, и любые изменения внутри функции не повлияют на оригинал.
Однако:
- Если передаётся указатель (*T), слайс, карта или канал, то содержимое может быть изменено.
- Структуры копируются целиком, если не передаются по указателю.


Ставь 👍 если знал ответ, 🔥 если нет
Забирай 📚Базу Знаний

BY Golang | Тесты


Share with your friend now:
tgoop.com/easy_golang_tests/1616

View MORE
Open in Telegram


Telegram News

Date: |

A vandalised bank during the 2019 protest. File photo: May James/HKFP. Telegram desktop app: In the upper left corner, click the Menu icon (the one with three lines). Select “New Channel” from the drop-down menu. How to Create a Private or Public Channel on Telegram? A few years ago, you had to use a special bot to run a poll on Telegram. Now you can easily do that yourself in two clicks. Hit the Menu icon and select “Create Poll.” Write your question and add up to 10 options. Running polls is a powerful strategy for getting feedback from your audience. If you’re considering the possibility of modifying your channel in any way, be sure to ask your subscribers’ opinions first. Members can post their voice notes of themselves screaming. Interestingly, the group doesn’t allow to post anything else which might lead to an instant ban. As of now, there are more than 330 members in the group.
from us


Telegram Golang | Тесты
FROM American