get package - cmd/go/internal/get - pkg.dev
文章推薦指數: 80 %
Command{ UsageLine: "go get [-d] [-f] [-t] [-u] [-v] [-fix] [build flags] [packages]", Short: "download and install packages and dependencies", Long: ` Get ...
WhyGo
GetStarted
Packages
Blog
Details
Validgo.modfile
TheGomodulesystemwasintroducedinGo1.11andistheofficialdependencymanagement
solutionforGo.
Redistributablelicense
Redistributablelicensesplaceminimalrestrictionsonhowsoftwarecanbeused,
modified,andredistributed.
Taggedversion
Moduleswithtaggedversionsgiveimportersmorepredictablebuilds.
Stableversion
Whenaprojectreachesmajorversionv1itisconsideredstable.
Learnmore
Repository
cs.opensource.google/go/go
Jumpto...
Documentation
Overview
Index
Constants
Variables
Functions
Types
SourceFiles
Documentation
Documentation
¶
Overview¶
Packagegetimplementsthe“goget”command.
Index¶
Variables
Constants¶
Thissectionisempty.
Variables¶
ViewSource
varCmdGet=&base.Command{
UsageLine:"goget[-d][-f][-t][-u][-v][-fix][buildflags][packages]",
Short:"downloadandinstallpackagesanddependencies",
Long:`
Getdownloadsthepackagesnamedbytheimportpaths,alongwiththeir
dependencies.Ittheninstallsthenamedpackages,like'goinstall'.
The-dflaginstructsgettostopafterdownloadingthepackages;thatis,
itinstructsgetnottoinstallthepackages.
The-fflag,validonlywhen-uisset,forcesget-unottoverifythat
eachpackagehasbeencheckedoutfromthesourcecontrolrepository
impliedbyitsimportpath.Thiscanbeusefulifthesourceisalocalfork
oftheoriginal.
The-fixflaginstructsgettorunthefixtoolonthedownloadedpackages
beforeresolvingdependenciesorbuildingthecode.
The-tflaginstructsgettoalsodownloadthepackagesrequiredtobuild
thetestsforthespecifiedpackages.
The-uflaginstructsgettousethenetworktoupdatethenamedpackages
andtheirdependencies.Bydefault,getusesthenetworktocheckout
missingpackagesbutdoesnotuseittolookforupdatestoexistingpackages.
The-vflagenablesverboseprogressanddebugoutput.
Getalsoacceptsbuildflagstocontroltheinstallation.See'gohelpbuild'.
Whencheckingoutanewpackage,getcreatesthetargetdirectory
GOPATH/src/
延伸文章資訊
- 1Go 1.16 中关于go get 和go install 你需要注意的地方 - MoeLove
概览 · 基本上 go install <package>@<version> 是用于命令的全局安装: · go get 安装二进制的功能,后续版本将会删除; · go get 主要被设计为修改...
- 2GoGet – 你的求職夥伴
- 3Go 套件管理
go get 會自行判斷該使用的協定,以這邊的例子來說,就會使用 git 來複製檔案庫至src 目錄底下,結果就是src/github.com/JustinSDK 底下,會有個goexample...
- 4[Go] 到底go get 的版號怎麼運作的?
在Go Module 模式底下使用go get 取得套件的時候常常會有各種版號出現,例如v1.0.2、v2.0.3 +incompatible、甚至是一段hash ...
- 5go get - GO 命令教程- 极客学院Wiki
命令 go get 可以根据要求和实际情况从互联网上下载或更新指定的代码包及其依赖包,并对它们进行编译和安装。在上面这个示例中,我们从著名的代码托管 ...