内容简介

Spot errors in your Go code you didn’t even know you were making and boost your productivity by avoiding common mistakes and pitfalls.

100 Go Mistakes and How to Avoid Them shows you how to:

Dodge the most common mistakes made by Go developers

Structure and organize your Go application

Handle data and control structures efficiently

Deal with errors in an idiomatic manner

Improve your concurrency skills

Optimize your code

Make your application production-ready and improve testing quality

100 Go Mistakes and How to Avoid Them puts a spotlight on common errors in Go code you might not even know you’re making. You’ll explore key areas of the language such as concurrency, testing, data structures, and more—and learn how to avoid and fix mistakes in your own projects. As you go, you’ll navigate the tricky bits of handling JSON data and HTTP services, discover best practices for Go code organization, and learn how to use slices efficiently.

下载地址

豆瓣评论

  • patrickstar
    值得一读。最后一章的一些例如padding技巧,其实一般来说用处不大,因为go基本上用于IO密集型应用,CPU的这点优化作用不会很明显。2023-12-07
  • 那人很像一条狗
    的错误、如何避免这些错误并深入分析其背后的原理,包括一些常见的错误,比如rang loop、defer使用问题,也有一些优化建议,比如减少内存申请次数、理解内存对齐、理解CPU缓存 cache line原理等等,也有一些是凑数的诸如项目结构代码结构之类的。新手老司机都适宜,总体来说非常具有实践意义的一本小书。2023-04-24
  • 贵吗跪好的
    Very helpful to my work. Code is the new law!2023-01-12

猜你喜欢

大家都喜欢