# goinit **Repository Path**: williamguang/goinit ## Basic Information - **Project Name**: goinit - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-06-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ----------------------------------------------------------------------------------------------------------------------------- ## 构建项目 - mkdir sg - cd sg - mkdir -vp {conf/dev,conf/test,controller,dao,libs,middleware,public,router} - go mod init sg go run main.go -c=./conf/config.yml ----------------------------------------------------------------------------------------------------------------------------- ### go mod 命令 ## 关于go mod - download - download modules to local cache(下载依赖包) - edit - edit go.mod from tools or scripts(编辑go.mod) - graph - print module requirement graph (打印模块依赖图) - init - initialize new module in current directory(在当前目录初始化mod) - tidy - add missing and remove unused modules(拉取缺少的模块,移除不用的模块) - vendor - make vendored copy of dependencies(将依赖复制到vendor下) - verify - verify dependencies have expected content (验证依赖是否正确) - why - explain why packages or modules are needed(解释为什么需要依赖) # go.mod 提供了module, require、replace和exclude 四个命令 - module 语句指定包的名字(路径) - require 语句指定的依赖项模块 - replace 语句可以替换依赖项模块 - exclude 语句可以忽略依赖项模块