golang websocket绑定用户_Golang 进阶文章一览

最近在组内 Code Review 发现很多同学学习时间虽然不短,但Golang的一些基本Pattern仍然有所疏漏。

譬如,RPC接口内随意go协程,不考虑调用量大之后,协程暴涨可能导致程序OOM。再譬如,协程不知道有哪些同步、退出机制。

如果时间不是问题,那么就是知识体系存在漏洞。那么一个体系化、结构化的指南,对他们应该会帮助,因此整理之前主体阅读过的经典文章,形成了本篇文章。

1、Golang Design Cornerstone

Do not communicate by sharing memory; instead, share memory by communicating.

《Share Memory By Communicating》
《Concurrency is not parallelism》

2、Concurrency Pattern

《Go Concurrency Patterns: Context》
《Go Concurrency Patterns: Pipelines and cancellation》
《Go Concurrency Patterns: Timing out, moving on》
《Advanced Go Concurrency Patterns》
《Context isn’t for cancellation》
《Never start a goroutine without knowing how it will stop》
《Rethinking Classical Concurrency Patterns》
《Timeouts and Deadlines》

3、Error Handling

《Errors are values》
《Don’t just check errors, handle them gracefully》

4、Naming

《Package names》
《Avoid package names like base, util, or common》

5、Package Management

《Using Go Modules》

6、Logging

《Let’s talk about logging》

7、Code Style

《SOLID Go Design》
《Do not fear first class functions》
《The Zen of Go》
《Clear is better than clever》
《Go, without package scoped variables》
《Should methods be declared on T or *T》
《Simplicity and collaboration》

8、Debug&Profile&Diagnostics

《Profiling Go Programs》
《Diagnostics》
《Stack Traces In Go》

9、TDD

《Prefer table driven tests》

10、Golang Struct

《If a map isn’t a reference variable, what is it?》
《Slices from the ground up》

11、精华网站

Gopher Academy Blog、The official Go Blog、Golang Talks、Go Wiki、Dave Cheney

本文作者:cyningsun本文地址: https://www.cyningsun.com/10-15-2020/advanced-golang-article.html版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-ND 3.0 CN 许可协议。转载请注明出处!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值