get package - cmd/go/internal/get - pkg.dev

文章推薦指數: 80 %
投票人數:10人

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/.IftheGOPATHcontainsmultipleentries, getusesthefirstone.Formoredetailssee:'gohelpgopath'. Whencheckingoutorupdatingapackage,getlooksforabranchortag thatmatchesthelocallyinstalledversionofGo.Themostimportant ruleisthatifthelocalinstallationisrunningversion"go1",get searchesforabranchortagnamed"go1".Ifnosuchversionexists itretrievesthedefaultbranchofthepackage. WhengogetchecksoutorupdatesaGitrepository, italsoupdatesanygitsubmodulesreferencedbytherepository. Getneverchecksoutorupdatescodestoredinvendordirectories. Formoreaboutspecifyingpackages,see'gohelppackages'. Formoreabouthow'goget'findssourcecodeto download,see'gohelpimportpath'. ThistextdescribesthebehaviorofgetwhenusingGOPATH tomanagesourcecodeanddependencies. Ifinsteadthegocommandisrunninginmodule-awaremode, thedetailsofget'sflagsandeffectschange,asdoes'gohelpget'. See'gohelpmodules'and'gohelpmodule-get'. Seealso:gobuild,goinstall,goclean. `, } ViewSource varHelpGopathGet=&base.Command{ UsageLine:"gopath-get", Short:"legacyGOPATHgoget", Long:` The'goget'commandchangesbehaviordependingonwhetherthe gocommandisrunninginmodule-awaremodeorlegacyGOPATHmode. Thishelptext,accessibleas'gohelpgopath-get'eveninmodule-awaremode, describes'goget'asitoperatesinlegacyGOPATHmode. Usage:`+CmdGet.UsageLine+` `+CmdGet.Long, } Functions¶ Thissectionisempty. Types¶ Thissectionisempty. SourceFiles ¶ Viewall get.go Jumpto Close Keyboardshortcuts ?:Thismenu /:Searchsite forF:Jumpto yorY :CanonicalURL Close



請為這篇文章評分?