✅ How to calculate stack size of a function?
Go calculates the maximum stack size a function will use at runtime at compile time.Code branches will all be considered in the calculation, even if some of them won't be executed.We can display function stack main sizes using the -S compiler option.
• the stack size of the foo function is 10056 bytes.
• the stack size of the main function is 64 bytes.
• the stack size of the duck function is 16024 bytes. Please note that, although the duck function is a de facto dummy function, its frame size is not zero. This fact will be made use of in a code optimization trick shown later.
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
Go calculates the maximum stack size a function will use at runtime at compile time.Code branches will all be considered in the calculation, even if some of them won't be executed.We can display function stack main sizes using the -S compiler option.
$ go run -gcflags=-S frame.go• the stack size of the bar function is 5024 bytes.
...
... TEXT "".bar(SB), ABIInternal, $5024-32
...
... TEXT "".foo(SB), ABIInternal, $10056-8
...
... TEXT "".main(SB), ABIInternal, $64-0
...
... TEXT "".duck(SB), ABIInternal, $16024-0
...
• the stack size of the foo function is 10056 bytes.
• the stack size of the main function is 64 bytes.
• the stack size of the duck function is 16024 bytes. Please note that, although the duck function is a de facto dummy function, its frame size is not zero. This fact will be made use of in a code optimization trick shown later.
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
👍3🏆1💊1
golangci.yaml
11.8 KB
✅ Professional configuration for lint using golangci-lint tool
Example alias for shell (you can save in bashrc or profile):
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
golangci-lint run --config=~/golangci.yaml ./...
Example alias for shell (you can save in bashrc or profile):
alias lnt="golangci-lint run --config=~/golangci.yaml ./..."
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
💊2👍1
In the official standard Go compiler implementation, each value of the following kinds of types always contains only one part:
🔰 @gopher_academy
✴️
boolean types
✴️
numeric types (int8, uint8, int16, uint16, int32, uint32, int64, uint64, int, uint, uintptr, float32,
float64, complex64, complex128)
✴️
pointer types
✴️
unsafe pointer types
✴️
struct types
✴️
array typesAnd a value of the following kinds of types always may contain one or more indirect parts:
✴️ slice types
✴️ map types
✴️ channel types
✴️ function types
✴️ interface types
✴️ string types
➖➖➖➖➖➖➖➖➖🔰 @gopher_academy
👍4🌭2
✅ جلسه دورهمی هفته دوم
- راس ساعت ۹
- موضوع نیم ساعت اول: همزمانی در زبان گو
- نیم ساعت دوم: بحث پرسش و پاسخ در خصوص مباحث مختلف
- لطفا میکروفون خود را mute و حالت Push to talk بزارید.
- اگر قصد صحبت دارید گزینه بلند کردن دست را بزنید.
🔗 https://meet.google.com/xdd-ouem-nas
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
- راس ساعت ۹
- موضوع نیم ساعت اول: همزمانی در زبان گو
- نیم ساعت دوم: بحث پرسش و پاسخ در خصوص مباحث مختلف
- لطفا میکروفون خود را mute و حالت Push to talk بزارید.
- اگر قصد صحبت دارید گزینه بلند کردن دست را بزنید.
🔗 https://meet.google.com/xdd-ouem-nas
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
Google
Real-time meetings by Google. Using your browser, share your video, desktop, and presentations with teammates and customers.
❤1
اسم پکیج برای پوشه ای داخلش استراکت ها تعریف می کنید
Anonymous Poll
38%
Models
12%
Model
13%
Entities
16%
Entity
11%
Domain
10%
( Comment )
💊2
💊2
اگه برای جواب این دوتا سوال منبع معتبر میشناسید ، خوشحال می شم به اشتراک بزارید
💊2
✅ پادکست جلسه دوم دورهمی مهندسین گولنگ
دوستان از طریق Spotify و Google Podcasts می توانید جلسه دوم دورهمی را گوش دهید.
- موضوع از پیش تعیین شده: همزمانی در گولنگ
🔗 https://open.spotify.com/show/6aQdgKiOF5tuzI7mpijlfj
🔗 https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy9kZGY3OWRiNC9wb2RjYXN0L3Jzcw
🔗 https://castbox.fm/va/5381928
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
دوستان از طریق Spotify و Google Podcasts می توانید جلسه دوم دورهمی را گوش دهید.
- موضوع از پیش تعیین شده: همزمانی در گولنگ
🔗 https://open.spotify.com/show/6aQdgKiOF5tuzI7mpijlfj
🔗 https://podcasts.google.com/feed/aHR0cHM6Ly9hbmNob3IuZm0vcy9kZGY3OWRiNC9wb2RjYXN0L3Jzcw
🔗 https://castbox.fm/va/5381928
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
Spotify
Persian Golang Engineers
Listen to Persian Golang Engineers on Spotify. We are a community of developers who love programming in Golang and are passionate about building high-performance, scalable, and efficient applications. Our group is a space for sharing knowledge, discussing…
👍8❤1
موضوع دورهمی هفته سوم در تاریخ 18 فروردین؟
Final Results
35%
بحث و گفتگو درخصوص معماری نرم افزار و ساختار پروژه
14%
بحث و گفتگو درخصوص Cloud Native
9%
بحث و گفتگو درخصوص اصول نرم افزار (solid, dry, kiss)
10%
بحث و گفتگو درخصوص معماری Saga و چالش های پیاده سازیش
8%
بحث و گفتگو درخصوص کتابخانه های استاندارد زبان گو
6%
بحث و گفتگو درخصوص جنریک
13%
بحث و گفتگو درخصوص TDD و انواع تست ها
2%
بحث و گفتگو درخصوص راهکارهای بهینه سازی
3%
بحث و گفتگو درخصوص Profiling