”工欲善其事,必先利其器。“—孔子《论语.录灵公》
首页 > 编程 > 学习 Golang 的最佳资源

学习 Golang 的最佳资源

发布于2024-11-01
浏览:342

Hi there! I haven’t introduced myself yet, as I haven’t had the chance. My name is Harutyun {ha.root.eeoon}, and I’m a Software Engineer and passionate Golang Developer. I really adore the language and enjoy working with its toolchain. I’ve been working with Go for the past five years. Before switching to Golang, I worked as a Full Stack Developer, with PHP as my main backend language and JS jQuery for the frontend.

At that time, I noticed that many companies were transitioning to Golang from Ruby, NodeJS, and PHP to improve latency, introduce concurrency, and enable background task execution for their products. The first article I came across was on Shopify’s blog, explaining how switching to Golang improved their service latency by 80%. I was fascinated by the article and began reading up on references, language concepts, and Golang’s official blog to better understand the language.

After PHP, Golang felt like a breath of fresh air—everything was fast, incredibly fast. I remember the first program I wrote: a file checksum validator for some open-sourced NASA data from the Apollo mission. It involved a collection of five files, each around 2GB in size. Seeing an execution time of 1.4 seconds blew my mind. At that moment, I knew I had to switch my stack to Golang to create and develop awesome software.

In this article, I want to share some resources that helped me become a Golang Engineer and continue to help me develop new skills while staying up to date with the latest technologies.

Books: The Saint Triada

The Best Resources for Learning Golang

Get Programming with Go by Nathan Youngman and Roger Peppé

If you’re just getting started with Go and want a book that makes the learning process easy and approachable, I highly recommend “Get Programming with Go” by Nathan Youngman and Roger Peppé. This book is perfect for beginners because it really focuses on the basics without overwhelming you with too much information at once. What’s great about this book is how clearly it explains everything. It starts right from the ground up, walking you through the core concepts of Go step-by-step. You’ll learn the essentials like how to declare variables, use loops, and write functions, but the authors do it in a way that’s super accessible—even if you don’t have a ton of programming experience.

If you’re new to Go or even new to programming in general, “Get Programming with Go” is one of the best places to start. It’s designed to help you build a strong foundation in the language without feeling lost or frustrated, and by the time you’re finished, you’ll have a solid understanding of how Go works. One thing I really liked is that the book doesn’t assume you already know a bunch of other programming languages. It’s written in plain language and focuses on helping you understand Go’s syntax and structure in a simple, straightforward way. It also covers Go’s unique approach to things like error handling and memory management, but again, in a way that’s very beginner-friendly.

Learning Go by Jon Bodner

If you’ve already gone through “Get Programming with Go” and are looking to take your Go skills to the next level, I highly recommend following up with “Learning Go” by Jon Bodner. While “Get Programming with Go” gives you a solid foundation and introduces the language in a very beginner-friendly way, “Learning Go” goes deeper into the more complex aspects of the language, perfect for when you’re ready to explore Go in greater detail.

This book builds on the basics and really helps you understand the intricacies of Go, like its concurrency model, interfaces, and error handling. Where the first book focuses on helping you get started, “Learning Go” dives deeper into Go’s unique features, and it gives you a much clearer picture of how to write more efficient, maintainable code. The explanations are still very approachable, but they’re more comprehensive, covering concepts that you might not have tackled yet. So if you’ve finished “Get Programming with Go” and are ready for more depth, “Learning Go” is the perfect next step. It’s a great way to continue your Go journey and really master the language.

100 Go Mistakes and How to Avoid Them by Teiva Harsanyi

After building a solid foundation with “Get Programming with Go” and diving deeper into Go’s core concepts with “Learning Go”, the next logical step in mastering the language is “100 Go Mistakes and How to Avoid Them” by Teiva Harsanyi. This book is the perfect continuation of your Go journey because it shifts the focus from learning the language to refining your skills and avoiding common pitfalls that even experienced developers encounter.

Where the previous two books helped you understand how Go works and how to use its features, “100 Go Mistakes” takes a more practical, hands-on approach by highlighting real-world mistakes that often trip up developers and how to steer clear of them. It’s a fantastic resource for developers who want to sharpen their expertise by learning from others’ experiences. The book covers mistakes across a wide range of topics, including concurrency, error handling, testing, and memory management, giving you insights into how to write more robust, efficient, and bug-free Go code. It’s not just about coding best practices, but about understanding the deeper reasons behind why certain approaches might seem right at first but can lead to subtle errors later. This book is invaluable for improving your Go skills, helping you think more critically about your code, and ensuring you avoid common traps as you progress toward writing more professional-level Go programs.

Each book builds upon the previous one, ensuring a comprehensive learning journey from the basics to mastering Go’s intricacies. You start with “Get Programming with Go” to establish a solid foundation, as it introduces the language in a simple, beginner-friendly way. “Learning Go” then takes you deeper into Go’s core features and concepts, giving you a more thorough understanding of the language’s capabilities. Finally, “100 Go Mistakes and How to Avoid Them” focuses on practical, real-world advice, helping you identify and avoid common pitfalls, making you a more efficient and confident Go developer.

BONUS Book

The Best Resources for Learning Golang

Test-Driven Development in Go by Adelina Simion

"Test-Driven Development in Go" by Adelina Simion is the latest addition to my collection. With its fresh perspective and modern approach to TDD, this book will further solidify developers ability to write reliable, thoroughly tested Go code while keeping up with the latest development practices. This book will guide you through adopting test-driven development, ensuring that your Go code is not only functional but also robust and maintainable. By focusing on writing tests first and using them to guide your coding process, you’ll gain deeper insights into producing higher-quality code.

Blogs: Go Wisdom and Witty Wonders

research!rsc: Thoughts and links about programming, by Russ Cox

https://research.swtch.com

It’s the personal blog of Russ Cox, a key contributor to the Go programming language. Russ Cox is one of the original developers of Go and has written extensively about the language, its development, and software engineering concepts in general. His blog covers deep technical topics, particularly around Go’s design decisions, tooling, concurrency model, and performance optimizations. It’s an excellent resource for gaining insight into Go’s evolution and understanding the rationale behind many of the language’s features. Cox also writes about broader topics related to programming languages, compilers, and computer science theory. It’s a go-to for developers who want to dive into the intricacies of Go, and it offers unique perspectives on how Go is designed to solve practical problems.

Dave Cheney: The acme of foolishness

https://dave.cheney.net

Dave Cheney is a prominent figure in the Go community and has contributed significantly to the language, particularly in areas like performance optimization, error handling, and best practices. His blog is well-known for providing in-depth, practical advice on writing idiomatic and efficient Go code. Topics he covers include Go’s concurrency model, memory management, testing strategies, and performance tuning. Dave is also known for breaking down complex topics in an accessible way, making his blog an excellent resource for both beginner and advanced Go developers. He has written about common Go design patterns, performance pitfalls, and how to get the most out of the language’s features, offering tips that help developers write more robust and maintainable Go programs. If you’re looking to deepen your understanding of Go or explore advanced techniques, Dave Cheney’s blog is a fantastic resource.

Julia Evans' Blog

https://jvns.ca

While Julia’s blog isn’t exclusively about Go, it’s well-known for its approachable and insightful posts on a wide range of technical topics, including systems programming, debugging, networking, and sometimes Go. Her writing style is casual and highly readable, making complex subjects easier to understand, even for beginners. One of the things that sets Julia apart is her ability to take intricate concepts whether it’s networking fundamentals or how operating systems work and break them down into simple, digestible posts. She often uses zines and illustrations to make technical content more engaging, which is a unique aspect of her blog. Even though Go is not the primary focus, when she does write about Go, it’s from a practical, systems-level perspective. If you’re into systems programming and want to see how Go fits into that world, Julia Evans’ blog is a great resource!

The Go Blog

https://go.dev/blog/

The official blog for the Go programming language, maintained by the Go team at Google. This blog covers new releases, features, design decisions, and community updates. It’s a great source for understanding Go from the perspective of the core developers. It’s the primary source of updates, news, and in-depth posts about the Go programming language, maintained by the core Go development team at Google. This blog covers a wide range of topics, including:

  • New Go releases: Detailed explanations of what’s new in each version, including features, bug fixes, and improvements.
  • Language design decisions: Insights into why certain features were added or how Go continues to evolve.
  • Best practices: Articles on how to use Go more effectively, including tips on performance optimization, memory management, and concurrency.
  • Community and ecosystem updates: Highlights of community projects, Go conferences, and tools that enhance the Go ecosystem.

Useful Telegram channels

Unfortunately, these are Russian-only channels, and most of the posts come from Russian sources, so they may not be a good fit for many. But if you know Russian, you’re all set!

  • @goproglib - All the most useful things for a Go developer in one channel.
  • @go_in_action - Everything about the Go programming language in Russian and English
  • @golangtests - Golang challenges
  • @golang_interview - Golang challenges and interview preparation resources

Conclusion

Learning Go is a rewarding journey, and having the right resources makes all the difference. Whether you’re just starting out or looking to dive deep into more advanced concepts, the blogs and books mentioned here offer invaluable insights and guidance. From mastering the basics to avoiding common pitfalls, these resources have been carefully curated to ensure you can develop your Go skills effectively and confidently.

As you continue exploring Go, remember that the strength of the Go community lies not only in its powerful language but also in its willingness to share knowledge. The resources available today reflect the hard work and dedication of countless contributors who want to help you succeed. Dive in, keep learning, and enjoy the process because with Go, the possibilities are endless!

A Huge Thank You to the Go Community!

I want to take a moment to express my appreciation for the incredible resources that have made learning Go such a rewarding experience. From in-depth blog posts on language design and performance to practical advice on writing efficient, idiomatic code, the contributions of so many in the community have been invaluable. The clarity, passion, and dedication behind these resources have helped countless developers, including myself, improve and grow.

Thank you for making Go such an enjoyable and enriching journey for all of us!

版本声明 本文转载于:https://dev.to/crusty0gphr/the-best-resources-for-learning-golang-51f6?1如有侵犯,请联系[email protected]删除
最新教程 更多>
  • 如何限制动态大小的父元素中元素的滚动范围?
    如何限制动态大小的父元素中元素的滚动范围?
    在交互式接口中实现垂直滚动元素的CSS高度限制问题:考虑一个布局,其中我们具有与用户垂直滚动一起移动的可滚动地图div,同时与固定的固定sidebar保持一致。但是,地图的滚动无限期扩展,超过了视口的高度,阻止用户访问页面页脚。 映射{} 因此。我们不使用jQuery的“ .aimimate(...
    编程 发布于2025-03-18
  • 我可以将加密从McRypt迁移到OpenSSL,并使用OpenSSL迁移MCRYPT加密数据?
    我可以将加密从McRypt迁移到OpenSSL,并使用OpenSSL迁移MCRYPT加密数据?
    将我的加密库从mcrypt升级到openssl 问题:是否可以将我的加密库从McRypt升级到OpenSSL?如果是这样,如何?答案:是的,可以将您的Encryption库从McRypt升级到OpenSSL。可以使用openssl。附加说明: [openssl_decrypt()函数要求iv参...
    编程 发布于2025-03-18
  • 对象拟合:IE和Edge中的封面失败,如何修复?
    对象拟合:IE和Edge中的封面失败,如何修复?
    To resolve this issue, we employ a clever CSS solution that solves the problem:position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%)...
    编程 发布于2025-03-18
  • 如何从PHP中的数组中提取随机元素?
    如何从PHP中的数组中提取随机元素?
    从阵列中的随机选择,可以轻松从数组中获取随机项目。考虑以下数组:; 从此数组中检索一个随机项目,利用array_rand( array_rand()函数从数组返回一个随机键。通过将$项目数组索引使用此键,我们可以从数组中访问一个随机元素。这种方法为选择随机项目提供了一种直接且可靠的方法。
    编程 发布于2025-03-18
  • 为什么不使用CSS`content'属性显示图像?
    为什么不使用CSS`content'属性显示图像?
    在Firefox extemers属性为某些图像很大,&& && && &&华倍华倍[华氏华倍华氏度]很少见,却是某些浏览属性很少,尤其是特定于Firefox的某些浏览器未能在使用内容属性引用时未能显示图像的情况。这可以在提供的CSS类中看到:。googlepic { 内容:url(&#...
    编程 发布于2025-03-18
  • 为什么尽管有效代码,为什么在PHP中捕获输入?
    为什么尽管有效代码,为什么在PHP中捕获输入?
    在php ;?>" method="post">The intention is to capture the input from the text box and display it when the submit button is clicked.但是,输出...
    编程 发布于2025-03-18
  • 如何使用替换指令在GO MOD中解析模块路径差异?
    如何使用替换指令在GO MOD中解析模块路径差异?
    在使用GO MOD时,在GO MOD 中克服模块路径差异时,可能会遇到冲突,其中可能会遇到一个冲突,其中3派对软件包将另一个带有导入套件的path package the Imptioned package the Imptioned package the Imported tocted pac...
    编程 发布于2025-03-18
  • 如何干净地删除匿名JavaScript事件处理程序?
    如何干净地删除匿名JavaScript事件处理程序?
    删除匿名事件侦听器将匿名事件侦听器添加到元素中会提供灵活性和简单性,但是当要删除它们时,可以构成挑战,而无需替换元素本身就可以替换一个问题。 element? element.addeventlistener(event,function(){/在这里工作/},false); 要解决此问题,请考虑...
    编程 发布于2025-03-18
  • Android如何向PHP服务器发送POST数据?
    Android如何向PHP服务器发送POST数据?
    在android apache httpclient(已弃用) httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(“ http://www.yoursite.com/script.p...
    编程 发布于2025-03-18
  • Python读取CSV文件UnicodeDecodeError终极解决方法
    Python读取CSV文件UnicodeDecodeError终极解决方法
    在试图使用已内置的CSV模块读取Python中时,CSV文件中的Unicode Decode Decode Decode Decode decode Error读取,您可能会遇到错误的错误:无法解码字节 在位置2-3中:截断\ uxxxxxxxx逃脱当CSV文件包含特殊字符或Unicode的路径逃...
    编程 发布于2025-03-18
  • 如何使用Java.net.urlConnection和Multipart/form-data编码使用其他参数上传文件?
    如何使用Java.net.urlConnection和Multipart/form-data编码使用其他参数上传文件?
    使用http request 上传文件上传到http server,同时也提交其他参数,java.net.net.urlconnection and Multipart/form-data Encoding是普遍的。 Here's a breakdown of the process:Mu...
    编程 发布于2025-03-18
  • 为什么使用Firefox后退按钮时JavaScript执行停止?
    为什么使用Firefox后退按钮时JavaScript执行停止?
    导航历史记录问题:JavaScript使用Firefox Back Back 此行为是由浏览器缓存JavaScript资源引起的。要解决此问题并确保在后续页面访问中执行脚本,Firefox用户应设置一个空功能。 警报'); }; alert('inline Alert')...
    编程 发布于2025-03-18
  • 为什么我会收到MySQL错误#1089:错误的前缀密钥?
    为什么我会收到MySQL错误#1089:错误的前缀密钥?
    mySQL错误#1089:错误的前缀键错误descript [#1089-不正确的前缀键在尝试在表中创建一个prefix键时会出现。前缀键旨在索引字符串列的特定前缀长度长度,可以更快地搜索这些前缀。了解prefix keys `这将在整个Movie_ID列上创建标准主键。主密钥对于唯一识别...
    编程 发布于2025-03-18
  • HTML格式标签
    HTML格式标签
    HTML 格式化元素 **HTML Formatting is a process of formatting text for better look and feel. HTML provides us ability to format text without us...
    编程 发布于2025-03-18
  • PHP阵列键值异常:了解07和08的好奇情况
    PHP阵列键值异常:了解07和08的好奇情况
    PHP数组键值问题,使用07&08 在给定数月的数组中,键值07和08呈现令人困惑的行为时,就会出现一个不寻常的问题。运行print_r($月份)返回意外结果:键“ 07”丢失,而键“ 08”分配给了9月的值。此问题源于PHP对领先零的解释。当一个数字带有0(例如07或08)的前缀时,PHP将...
    编程 发布于2025-03-18

免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。

Copyright© 2022 湘ICP备2022001581号-3