-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
82 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,3 @@ | ||
# 2.1 Go包机制 | ||
# 2.1 Go1的包机制 | ||
|
||
<!-- | ||
1. | ||
语言只定义了包的概念 | ||
包可以有不同的实现,比如基于zip的包集合 | ||
最早是没有gopath的 | ||
makefile时代的编译,和goroot是放在一起的 | ||
2. | ||
gopath | ||
intrnal | ||
vendor | ||
和std同名的包 | ||
3. | ||
vendor的问题 | ||
本质原因是不同包中的类型不一样 | ||
vendor内的包对应新路径的包 | ||
4. 模块的设计⽬标 | ||
问题,有时候需要调试,临时修改以来包的代码, | ||
但是修改之后会导致其它依赖此包的应用被影响,可以用replace吗 | ||
5. 模块快速⼊⻔ | ||
6. go.mod 和 go.sum⽂件 | ||
7. go get重新⼊⻔ | ||
8. 语义化版本号 | ||
9. v1/v2/v3版本共存 | ||
10. ⼦模块 | ||
11. 最⼩化版本选择 | ||
12. 版本不相容和间接依赖 | ||
13. go mod命令 | ||
14. 私有仓库/镜像 | ||
以前是每个pkg的go get需要DNS查网址,如果要定制指南修改hosts文件, | ||
但是修改hosts文件将对其它应用产生影响。 | ||
--> | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 2.2 基于vendor的版本管理 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 2.3 模块的设计⽬标 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 2.1 模块快速⼊⻔ | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 2.5 子模块和多版本共存 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 2.6 镜像和私有仓库 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 2.7 模块化实践中的一些问题 | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# 第2章 模块化 | ||
|
||
TODO | ||
模块化也称为包依赖管理,是管理任何大型工程必备的工具。Go语言发布十年来一直缺乏官方的模块化工具。同样在2018年,作为Go语言团队的技术领导人Russ Cox终于出手,重新发明了称为最小版本选择的包依赖管理的规则并提交了提案。模块特性已经被实验性地集成到Go1.11中,并将在后续版本中逐渐转化为正式特性。模块化的特性将彻底解决大型Go语言工程的管理问题,至此Go1除了缺少泛型等特性已经近乎完美。本章讨论模块相关的使用。 |