diff --git a/Golang/Golang Document.md b/Golang/Golang Document.md new file mode 100644 index 0000000..a890adf --- /dev/null +++ b/Golang/Golang Document.md @@ -0,0 +1,14 @@ +# Golang +## Get Started +### Enable dependency tracking +当代码对其他module中包含的package进行了import时,在自己的module中来管理依赖。 + +自己的module通过`go.mod`文件来定义,`go.mod`文件中会track项目所需要的依赖。 + +#### go mod init +`go mod init `命令会创建一个`go.mod`文件,其中``会是module path。 + +在实际开发中,module name通常是source code被保存的repository location,例如,`uuid`module的module name为`github.com/google/uuid`。 + +#### go mod tidy +`go mod tidy`命令会根据import添加缺失的module并且移除未使用的module。 \ No newline at end of file