# 第 7 期:依赖与模块
主持:[杨文](https://maiyang.me),[欧长坤](https://changkun.de)
嘉宾:[盛傲飞](https://aofeisheng.com)
本期摘要:这是 Go 夜聊的第七期节目,我们和 goproxy.cn 的作者在 Go 1.17 发布时聊了聊在 Go 语言中的依赖管理、模块等相关的机制。Go 语言中的 Modules 走到今天这一步经历了哪些波折?看似在其他语言里早已攻克的代码依赖管理,在 Go 语言的情景下,又有哪些不为人知的努力?
## 时间线
- 00:00 开场白
- 01:06 接触 Go 语言的契机
- 02:57 Beego 等一系列 Web 框架的对比
- 04:37 自己动手写 Web 框架
- 06:33 Go Modules 之前的依赖管理
- 16:12 Monorepo 代码管理的优劣
- 22:24 "臭名昭著" 的 GOPATH 和 vendor
- 28:36 dep 的风波
- 37:46 "独裁式" 管理风格下的需求工程
- 43:52 进入 Go Module 时代
- 46:47 Go Modules 的基本原理
- 52:40 godoc 和 pkg.go.dev
- 54:57 从 golang.org 合并到 go.dev 域名
- 66:22 Go Modules 的最小版本选择算法 MVS
- 70:27 环境变量 GOPRIVATE
- 72:25 模块的懒加载
- 77:36 模块别名机制
- 82:10 GOPATH 的废除与 Go 1 兼容性保证
- 84:43 Go Workspace 工作区
- 86:17 构建 goproxy.cn 的经历
- 89:57 搭建代理的难点及其与镜像站的区别
- 96:42 七牛云接管 goproxy.cn 的运营
## 相关链接
- [谢大 astaxie 写的 Beego](https://github.com/beego/beego)
- [知名 Web 框架 Gin](https://github.com/gin-gonic/gin)
- [曾经的知名 Web 框架 Martini](https://github.com/go-martini/martini)
- [知名 Web 框架 Echo](https://echo.labstack.com/)
- [傲飞 aofei 写的 Web 框架 air](https://github.com/aofei/air)
- [标准库 net/http](https://pkg.go.dev/net/http)
- [曾经的依赖管理工具 goven](https://github.com/kr/goven)
- [gopkg.in](https://labix.org/gopkg.in)
- [yaml 包](https://github.com/go-yaml/yaml)
- [无闻编写的 ini 解析包](https://github.com/go-ini/ini)
- [曾经的依赖管理工具 gopm](https://github.com/gpmgo/gopm)
- [曾经的依赖管理工具 govendor](https://github.com/kardianos/govendor)
- [曾经的依赖管理工具 dep](https://github.com/golang/dep)
- [Russ Cox 关于 vgo 依赖管理的演讲](https://www.youtube.com/watch?v=F8nrpe0XWRg)
- [Go Modules 的前身 vgo](https://github.com/golang/vgo)
- [Go Modules 规范](https://go.dev/ref/mod)
- [Russ Cox 和 Rob Pike 开发的 licensecheck](https://pkg.go.dev/github.com/google/licensecheck)
- [模块功能目前的主要开发者 Bryan C. Mills](https://github.com/bcmills)
- [傲飞开发的 Go 模块代理站 goproxy.cn](https://goproxy.cn/)
- [李保坤开发的 Go 模块代理站 goproxy.io](https://goproxy.io/)
- [曾经的文包文档站 godoc.org 的源码](https://github.com/golang/gddo)
- [Go 语言的多模块工作区 Workspace 的提案](https://go.dev/design/45713-workspace)
- [模块别名功能的相关讨论](https://go.dev/issue/26904)
- [尾声推荐:jellyfin.org](https://jellyfin.org/)
- [嘉宾推荐:The Art of Multiprocessor Programming (2nd Edition)](https://www.amazon.com/Art-Multiprocessor-Programming-Maurice-Herlihy/dp/0124159508/)
- [嘉宾推荐:golang.design/go2generics](https://github.com/golang-design/go2generics)