go-patterns
go-patterns copied to clipboard
Go 语言编程模式最佳实践
go-patterns
Go 语言编程模式最佳实践,来源于耗子叔的博客分享总结,十分感谢。
也欢迎访问耗子叔的博客学习更多知识:https://coolshell.cn
一、切片,接口,性能
参考阅读:
50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs
二、错误处理
参考阅读:
Golang Error Handling lesson by Rob Pike
Working with Errors in Go 1.13
Golang: Six Error Handling techniques to help you write elegant code
三、Functional Options
参考阅读:
Self-referential functions and the design of options
Implementing the Options Pattern in Golang
四、委托和控制反转
参考阅读:
Dependency Injection and IoC Container in Go
五、Map-Reduce
参考阅读:
Simple apply/filter/reduce package — Rob Pike
六、Go Generation
七、修饰器模式
参考阅读:
八、Pipeline
参考阅读:
Go Concurrency Patterns: Pipelines and cancellation
九、Visitor 模式
参考阅读: