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

学习 Golang 的最佳资源

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

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]删除
最新教程 更多>
  • 如何使用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-20
  • 版本5.6.5之前,使用current_timestamp与时间戳列的current_timestamp与时间戳列有什么限制?
    版本5.6.5之前,使用current_timestamp与时间戳列的current_timestamp与时间戳列有什么限制?
    在时间戳列上使用current_timestamp或MySQL版本中的current_timestamp或在5.6.5 此限制源于遗留实现的关注,这些限制需要对当前的_timestamp功能进行特定的实现。 创建表`foo`( `Productid` int(10)unsigned not n...
    编程 发布于2025-03-20
  • 为什么使用Firefox后退按钮时JavaScript执行停止?
    为什么使用Firefox后退按钮时JavaScript执行停止?
    导航历史记录问题:JavaScript使用Firefox Back Back 此行为是由浏览器缓存JavaScript资源引起的。要解决此问题并确保在后续页面访问中执行脚本,Firefox用户应设置一个空功能。 警报'); }; alert('inline Alert')...
    编程 发布于2025-03-20
  • 如何干净地删除匿名JavaScript事件处理程序?
    如何干净地删除匿名JavaScript事件处理程序?
    删除匿名事件侦听器将匿名事件侦听器添加到元素中会提供灵活性和简单性,但是当要删除它们时,可以构成挑战,而无需替换元素本身就可以替换一个问题。 element? element.addeventlistener(event,function(){/在这里工作/},false); 要解决此问题,请考虑...
    编程 发布于2025-03-20
  • 为什么我的CSS背景图像出现?
    为什么我的CSS背景图像出现?
    故障排除:CSS背景图像未出现 ,您的背景图像尽管遵循教程说明,但您的背景图像仍未加载。图像和样式表位于相同的目录中,但背景仍然是空白的白色帆布。而不是不弃用的,您已经使用了CSS样式: bockent {背景:封闭图像文件名:背景图:url(nickcage.jpg); 如果您的html,css...
    编程 发布于2025-03-20
  • 如何在JavaScript对象中动态设置键?
    如何在JavaScript对象中动态设置键?
    在尝试为JavaScript对象创建动态键时,如何使用此Syntax jsObj['key' i] = 'example' 1;不工作。正确的方法采用方括号: jsobj ['key''i] ='example'1; 在JavaScript中,数组是一...
    编程 发布于2025-03-20
  • Python读取CSV文件UnicodeDecodeError终极解决方法
    Python读取CSV文件UnicodeDecodeError终极解决方法
    在试图使用已内置的CSV模块读取Python中时,CSV文件中的Unicode Decode Decode Decode Decode decode Error读取,您可能会遇到错误的错误:无法解码字节 在位置2-3中:截断\ uxxxxxxxx逃脱当CSV文件包含特殊字符或Unicode的路径逃...
    编程 发布于2025-03-20
  • 如何使用FormData()处理多个文件上传?
    如何使用FormData()处理多个文件上传?
    )处理多个文件输入时,通常需要处理多个文件上传时,通常是必要的。 The fd.append("fileToUpload[]", files[x]); method can be used for this purpose, allowing you to send multi...
    编程 发布于2025-03-20
  • 如何使用PHP从XML文件中有效地检索属性值?
    如何使用PHP从XML文件中有效地检索属性值?
    从php $xml = simplexml_load_file($file); foreach ($xml->Var[0]->attributes() as $attributeName => $attributeValue) { echo $attributeName,...
    编程 发布于2025-03-20
  • 大批
    大批
    [2 数组是对象,因此它们在JS中也具有方法。 切片(开始):在新数组中提取部分数组,而无需突变原始数组。 令ARR = ['a','b','c','d','e']; // USECASE:提取直到索引作...
    编程 发布于2025-03-20
  • 如何使用组在MySQL中旋转数据?
    如何使用组在MySQL中旋转数据?
    在关系数据库中使用mySQL组使用mySQL组进行查询结果,在关系数据库中使用MySQL组,转移数据的数据是指重新排列的行和列的重排以增强数据可视化。在这里,我们面对一个共同的挑战:使用组的组将数据从基于行的基于列的转换为基于列。 Let's consider the following ...
    编程 发布于2025-03-20
  • 如何在Java字符串中有效替换多个子字符串?
    如何在Java字符串中有效替换多个子字符串?
    在java 中有效地替换多个substring,需要在需要替换一个字符串中的多个substring的情况下,很容易求助于重复应用字符串的刺激力量。 However, this can be inefficient for large strings or when working with nu...
    编程 发布于2025-03-20
  • 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-20
  • 如何为PostgreSQL中的每个唯一标识符有效地检索最后一行?
    如何为PostgreSQL中的每个唯一标识符有效地检索最后一行?
    postgresql:为每个唯一标识符在postgresql中提取最后一行,您可能需要遇到与数据集合中每个不同标识的信息相关的信息。考虑以下数据:[ 1 2014-02-01 kjkj 在数据集中的每个唯一ID中检索最后一行的信息,您可以在操作员上使用Postgres的有效效率: id dat...
    编程 发布于2025-03-20
  • 可以在纯CS中将多个粘性元素彼此堆叠在一起吗?
    可以在纯CS中将多个粘性元素彼此堆叠在一起吗?
    [2这里: https://webthemez.com/demo/sticky-multi-header-scroll/index.html </main> <section> { display:grid; grid-template-...
    编程 发布于2025-03-20

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

Copyright© 2022 湘ICP备2022001581号-3