File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import (
12
12
//因为 go 编译器默认会在当前目录中查找src目录下package。 如果没有src目录,编译器就找不到相应的package
13
13
14
14
/*
15
-
15
+ ---->理论部分
16
16
依赖管理
17
17
Go未解决的依赖问题
18
18
1.同一环境下,不同项目使用同一包的不同版本
@@ -33,12 +33,17 @@ dodep:https://github.com/tools/godep
33
33
glide:https://github.com/Masterminds/glide
34
34
dep:https://github.com/golang/dep
35
35
36
+ ---->操作部分
36
37
window安装glide教程: https://www.cnblogs.com/nickchou/p/8955180.html
37
- 安装成功后,我们把src/github.com/easierway包的源文件删除,
38
- 在go-19/module_package目录下执行
38
+ 安装成功后,我们把src/github.com/easierway包的源文件删除,运行下面代码会报错找不到包
39
+ 然后在go-19/module_package目录下执行
40
+
41
+ ##初始化包管理
39
42
glide init
43
+ ##下载项目依赖
40
44
glide install
41
- 会重新下载包源文件到项目go-19/vendor目录下
45
+
46
+ 会重新下载包源文件到项目go-19/module_package/vendor目录下,glide.yaml文件就类似于maven文件,版本管理
42
47
43
48
遇到的问题:解决go build不去vendor下查找包的问题: https://www.jb51.net/article/202458.htm
44
49
问题总结:go 编译器默认会在当前目录中查找src目录下package。如果没有src目录,编译器就找不到相应的package
You can’t perform that action at this time.
0 commit comments