The official standard Go compiler make special optimizations to hash 4-byte and 8-byte map keys.
So, map[[8]byte]T is more CPU-saving than map[[5]byte]T.
The same, map[int32]T is more CPU-saving than map[int16]T and map[byte]T.
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
So, map[[8]byte]T is more CPU-saving than map[[5]byte]T.
The same, map[int32]T is more CPU-saving than map[int16]T and map[byte]T.
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
🔥4👍1
اگر دنبال این هستید که kubernetes رو عملی تست کنید و یادبگیرید و دنبال playground مجانی میگردید که تمرین کنید این سایت برای همین ساخته شده :)
#k8s
https://killercoda.com
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
#k8s
https://killercoda.com
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
❤9🐳1
🎉 Happy Birthday golang!
Did you know that 11 years ago today Go 1 was publicly released?
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
Did you know that 11 years ago today Go 1 was publicly released?
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
🎉9
1678218121157.pdf
800.7 KB
coding Concepts in Real Life
👉 Stack
👉 Queue
👉 LinkedList
👉 1D-Array
👉 2D-Array
👉 Tree
👉 graph
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👉 Stack
👉 Queue
👉 LinkedList
👉 1D-Array
👉 2D-Array
👉 Tree
👉 graph
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍1🐳1
✅ دوستان یک نکته ای در خصوص سرفصل ها و بخش های کتاب فارسی زبان گو بگم
تمامی سرفصل ها و بخش ها براساس تحلیل کتاب های مرتبط با زبان گو تنظیم شده و همچنین سرفصل ها و بخش ها برای آقای بیل کندی جهت review ارسال و تایید شده.
https://book.gofarsi.ir/
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
تمامی سرفصل ها و بخش ها براساس تحلیل کتاب های مرتبط با زبان گو تنظیم شده و همچنین سرفصل ها و بخش ها برای آقای بیل کندی جهت review ارسال و تایید شده.
https://book.gofarsi.ir/
➖➖➖➖➖➖➖➖➖
🔰@gopher_academy
زبان گو فارسی
صفحه اصلی
کتاب زبان فارسی آموزش زبان گو را بهطور عمیق از مفاهیم پایه تا مفاهیم کاملاً پیشرفته و تکنیکی مانند: سینتکس، پارادایمها، همزمانی (پایه تا پیشرفته) و...
❤4👍4
✅ 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