Home > other >  [white] after using the Go after the module, Go build and Go install what is the difference? How to
[white] after using the Go after the module, Go build and Go install what is the difference? How to

Time:09-18

After using the Go after the module, in addition to the generated exe position is not the same as the Go build and Go and what is the difference between the install?
On the go when the path go install -i will be generated in the PKG. A file, but the use of the go go after the module install - I don't seem to be generated. A, is this why?

CodePudding user response:

I think may be related to rely on the package management way,
Don't have to go the module (or go dep), rely on the package to oneself use go get downloaded to the local, and go the mod is to rely on download package to a temporary folder (PKG/mod), vendor go dep is downloaded to the current folder, use the go install -i, these depend on the source code package doesn't really exist go under the SRC path, so can't generate the same directory as the SRC structure in PKG, so also can't in the same directory to generate a PKG (generated a estimate is also in a temporary folder)

CodePudding user response:

reference 1st floor qybao response:
I think probably related to rely on the package management style
Don't have to go the module (or go dep), rely on the package to oneself use go get downloaded to the local, and go the mod is to rely on download package to a temporary folder (PKG/mod), vendor go dep is downloaded to the current folder, use the go install -i, these depend on the source code package doesn't really exist go under the SRC path, so can't generate the same directory as the SRC structure in PKG, so also can't in the same directory to generate a PKG (generated a estimate is also in a temporary folder)

As temporary folder also have no, I don't have the corresponding completely swept the. A file, so look like install this command has been useless ah, is more than build a exe into operation in the bin,
And as if can only use the build to generate. A, install seem unable to generate,
Is it because. A is a intermediate results of abandoned? Not to say that go to judge whether the source of the package at compile time have change, if not, is no longer a recompile. A, deleted. Don't make a speed down, but I seem to see the development of data in some places need to use. When a library file,,

CodePudding user response:

Go module mode, Go the install just compile package, and cache results, and did not install the operation, that is because there are other depend on its project compile time cache will speed up,

CodePudding user response:

reference Steven8902 reply: 3/f
Go module mode, Go the install just compile package, and cache results, and did not install the operation, that is because there are other depend on its project compile time cache will speed up,
seem to Go Go Go build and install under the module generated file is the same, in the/PKG/mod/cache \ download directory to download things, in addition to the location of the generated exe is different as other difference was found, don't have to. A,
  • Related