Golang Insights – Telegram
Golang Insights
760 subscribers
116 photos
7 videos
47 files
131 links
Stay ahead in Golang development with Golang Insights, your go-to for the latest news, tips, tricks, and code examples tailored for Golang enthusiasts and professionals.

Group: https://news.1rj.ru/str/GolangEngineers
Download Telegram
پروپوزال استفاده از علامت ? برای ساده‌سازی مدیریت خطا در زبان Go

پیشنهادی برای کاهش کدهای تکراری در مدیریت خطاها در زبان Go ارائه شده است که استفاده از علامت ? را معرفی می‌کند. این علامت به برنامه‌نویسان اجازه می‌دهد تا بررسی خطاها را به صورت مختصرتر و خواناتر انجام دهند. به عنوان مثال، به جای نوشتن:

r, err := SomeFunction()
if err != nil {
    return fmt.Errorf("something failed: %v", err)
}

می‌توان از این نحو جدید استفاده کرد:

r := SomeFunction() ? {
    return fmt.Errorf("something failed: %v", err)
}

در این ساختار، اگر مقدار بازگشتی خطا (err) نال نباشد، بلوک کد پس از ? اجرا می‌شود و متغیر err به صورت ضمنی در این بلوک تعریف می‌شود. همچنین، اگر بلوک کد پس از ? حذف شود، به صورت پیش‌فرض خطا بازگردانده می‌شود:

SomeFunction2() ?

این پیشنهاد با هدف کاهش کدهای تکراری و بهبود خوانایی کدهای مدیریت خطا در زبان Go مطرح شده است.


https://github.com/golang/go/discussions/71460


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
👎12👍7🥴31
Distributed_Caching_The_Secret_to_High_Performance_Applications.pdf
3.9 MB
Distributed Caching_ The Secret to High-Performance Applications

#bytebytego #tips #pro_guide

☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥2
Please open Telegram to view this post
VIEW IN TELEGRAM
3👍2
🚀 پروپوزال Go: بسته‌ی جدید sync/v2

هدف این پکیج نسخه دوم, معرفی نسخه‌های بهبودیافتهٔ انواع Map و Pool با استفاده از پارامترهای نوع (Generics) است تا ایمنی نوع در زمان کامپایل و کارایی بهتری فراهم شود. در نسخهٔ جدید، نوع Pool دیگر فیلد New صادرشده ندارد؛ به‌جای آن، از تابع NewPool برای ایجاد Pool استفاده می‌شود که تابعی را برای بازگرداندن مقادیر جدید فراخوانی می‌کند. همچنین، متد Get به‌روزرسانی شده و اکنون دو نتیجه بازمی‌گرداند؛ نتیجهٔ دوم یک مقدار بولی است که نشان می‌دهد آیا مقداری بازگردانده شده است یا خیر.

تغییرات کلیدی:

حذف فیلد New در Pool
به‌جای مقداردهی مستقیم New، اکنون از NewPool استفاده می‌شود:

p := sync.NewPool(func() *MyType {
return new(MyType)
})

v, ok := p.Get()
if !ok {
v = new(MyType) // در صورت خالی بودن، مقدار جدید ساخته شود
}


نسخه جنریک

var m sync.Map[string, int]
m.Store("key", 42)
v, ok := m.Load("key") // v مقدار int است


🔗 جزئیات بیشتر در گیت‌هاب


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
👍7
From Monolith to Microservices_ Key Transition Patterns.pdf
2.4 MB
From Monolith to Microservices_ Key Transition Patterns

#bytebytego #tips #pro_guide

☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
1
🚀 اولین کتاب گولنگی منتشر شده برای حرفه ای شدن!!!


اولین کتاب منتشر شده زبان گو از مبتدی تا حرفه ای شدن توسط مهندس مصطفی صولتی که حاصل بیش از ۱۰ سال تجربه ایشان در زمینه مهندسی نرم افزار و زبان گو است.



- خرید کتاب: https://www.digikala.com/product/dkp-16392533-

- پست اصلی در لینکدین جهت حمایت:‌ https://www.linkedin.com/feed/update/urn:li:activity:7291326916911898625/


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
20🔥3🥴1
Kubernetes_Made_Easy_A_Beginner’s_Roadmap_to_Container_Orchestration.pdf
3.8 MB
Kubernetes Made Easy_ A Beginner’s Roadmap to Container Orchestration

#bytebytego #tips #pro_guide

☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥31
Mastering_Modern_Authentication_Cookies,_Sessions,_JWT,_and_PASETO.pdf
3.3 MB
Mastering Modern Authentication_ Cookies, Sessions, JWT, and PASETO

#bytebytego #tips #pro_guide

☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
🥳 Go 1.23.6 and 1.22.12 are released!

🔐 Security: Includes a security fix for crypto/elliptic (CVE-2025-22866).

🔈 Announcement: https://groups.google.com/g/golang-announce/c/xU1ZCHUZw3k

🗃 Download: go.dev/dl/#go1.23.6


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
Speedrunning Guide_ Junior to Staff Engineer in 3 years.pdf
1.2 MB
Speedrunning Guide_ Junior to Staff Engineer in 3 years

#bytebytego #tips #pro_guide

☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
Forwarded from Golang Insights (Javad)
🚀 پکیج algo مجموعه‌ای از الگوریتم‌های پرفورمنس بالا و بهینه

سعی کردم در این پکیج یکسری الگوریتم های خاص بصورت بهینه و با بدون وابستگی به dependency های خارجی قرار دهم و فعلا یک الگوریتم را توسعه دادم و بزودی برخی الگوریتم های دیگر نظیر Reservoir Sampling, Consistent Hashing و برخی دیگر را قرار دهم.

در حال حاضر الگوریتم زیر را تکمیل کردم و قرار دادم.

انتخاب تصادفی وزنی (Random Weighted Selection)

📌 مشاهده پکیج و مستندات:
🔗 گیت‌هاب: https://github.com/Ja7ad/algo
📚 مستندات: https://pkg.go.dev/github.com/Ja7ad/algo

🔥 خوشحال می‌شوم نظرات و پیشنهاداتتان را بشنوم! اگر علاقه‌مند به مشارکت در توسعه این پکیج هستید، PR بفرستید! 💡


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
6🔥3👍2
🎊 Go 1.24 Release Candidate 3 is released!

📄 draft note: https://tip.golang.org/doc/go1.24

🔈 Announcement: https://groups.google.com/g/golang-announce/c/vYMfuq_XO6w

📦 Download: go.dev/dl/#go1.24rc3


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
😁5
1.Corporation Specifications and Workflows.pdf
75.1 KB
فرصت شغلی برای برنامه‌نویسان ایرانی

اگر بدنبال فرصت شغلی ریموت هستید یک فرصت استثنایی برای برنامه‌نویسان ایرانی هست.

اطلاعات داخل داکیومنت پیوست شده هست.

در صورتی که مایل بودین با یوزر زیر تماس بگیرید.

@robshyver


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1
Please open Telegram to view this post
VIEW IN TELEGRAM
🧨 Go 1.24.0 is released!

📝 Release notes: https://go.dev/doc/go1.24

⬇️ Download: https://go.dev/dl/#go1.24.0


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
4🔥1
بهبود عملکرد و مصرف منابع چشم گیر با Swiss Table

جدول سوییسی یک الگوریتم جدید برای ساختار map در Go 1.24 است که جایگزین هش‌تیبل قدیمی شده. این روش باعث سرعت بیشتر، مصرف حافظه کمتر و تخصیص‌های کمتر در عملیات خواندن، نوشتن و تغییر مقدار در map می‌شود.

در زیر یک بنچمارک انجام دادیم با go 1.24 و تقریبا نتیجه خیلی چشم گیر خوب بود:

hash table

cpu: AMD Ryzen 7 5700U with Radeon Graphics         
BenchmarkRead-16 100000000 11.01 ns/op 0 B/op 0 allocs/op
BenchmarkWrite-16 7 161118909 ns/op 87729269 B/op 38401 allocs/op
BenchmarkModify-16 46085539 25.85 ns/op 0 B/op 0 allocs/op
PASS
ok hash table 6.132s


swiss table
cpu: AMD Ryzen 7 5700U with Radeon Graphics         
BenchmarkRead-16 100000000 10.55 ns/op 0 B/op 0 allocs/op
BenchmarkWrite-16 7 155943380 ns/op 75513976 B/op 8198 allocs/op
BenchmarkModify-16 48564434 24.87 ns/op 0 B/op 0 allocs/op
PASS
ok swiss table 5.044s


که در جدول پیوست شده تقریبا در مجموع 17.8% نسبت به hash table سریعتر است.


☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
162👍1🆒1
Clean Architecture 101_ Building Software That Lasts.pdf
2.7 MB
Clean Architecture 101_ Building Software That Lasts

#bytebytego #tips #pro_guide

☄️ @GoInsights | @GolangEngineers
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1