mirror of
https://github.com/chai2010/go2-book.git
synced 2025-06-07 01:58:35 +00:00
zz
This commit is contained in:
parent
9a0a21f3d8
commit
4d9d43bb7d
@ -38,4 +38,4 @@
|
||||
|
||||
| 支付宝 | 微信 |
|
||||
|:-----:|:-----:|
|
||||
|||
|
||||
|||
|
||||
|
50
ch2/ch2-1.md
Normal file
50
ch2/ch2-1.md
Normal file
@ -0,0 +1,50 @@
|
||||
# 2.1 Go包机制
|
||||
|
||||
<!--
|
||||
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文件将对其它应用产生影响。
|
||||
|
||||
-->
|
@ -1 +1,3 @@
|
||||
# 第2章 模块化
|
||||
|
||||
TODO
|
||||
|
BIN
images/donate-alipay-github-chai2010-20yuan.jpg
Normal file
BIN
images/donate-alipay-github-chai2010-20yuan.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
Binary file not shown.
Before Width: | Height: | Size: 33 KiB |
BIN
images/donate-weixin-github-chai2010-20yuan.jpg
Normal file
BIN
images/donate-weixin-github-chai2010-20yuan.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
Before Width: | Height: | Size: 28 KiB |
Loading…
x
Reference in New Issue
Block a user