You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
YES
What operating system and processor architecture are you using (go env)?
Mac OS 10.13.6
What did you do?
go mod download -json
What did you expect to see?
Information on location of downloaded files, INCLUDING location of replacements.
What did you see instead?
Information on the location of downloaded files, but replacements are NOT included. There is no entry at all for replaced items.
The Issue
Many Go projects are not just Go source code. For example, a web application has assets - css, JavaScript, images, etc. It also has scripts important to the build process, including files that have go:generate commands. The module system needs to understand that it is not just managing Go code, but everything in a repo that a build has to get to.
In order for a build system to work, and to be reproducible, it needs to know where to find EVERYTHING. go mod download -json helps, but because its not "replace" aware, it fails to completely support a build process. In my particular situation, I am using "replace" to point to local development changes of a variety of tools, some of which do code-generation that then get compiled into other tools. To test local changes, my build system needs to know where these files are located.
In order to fix this, I will need to parse the local go.mod file, or create some kind of parallel system to specify where things are. I shouldn't have to do that.
Proposals
Have go mod download -json be replace aware. It could output additional entries specific to "replace" statements. Unfortunately, this might break tools relying on the current output format.
Create a new tool, go mod where or go mod download -where that would simply output a module name and the path to the source of that module, including anything gathered from "replace" statements.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?1.11.2
Does this issue reproduce with the latest release?
YES
What operating system and processor architecture are you using (
go env
)?Mac OS 10.13.6
What did you do?
go mod download -json
What did you expect to see?
Information on location of downloaded files, INCLUDING location of replacements.
What did you see instead?
Information on the location of downloaded files, but replacements are NOT included. There is no entry at all for replaced items.
The Issue
Many Go projects are not just Go source code. For example, a web application has assets - css, JavaScript, images, etc. It also has scripts important to the build process, including files that have go:generate commands. The module system needs to understand that it is not just managing Go code, but everything in a repo that a build has to get to.
In order for a build system to work, and to be reproducible, it needs to know where to find EVERYTHING.
go mod download -json
helps, but because its not "replace" aware, it fails to completely support a build process. In my particular situation, I am using "replace" to point to local development changes of a variety of tools, some of which do code-generation that then get compiled into other tools. To test local changes, my build system needs to know where these files are located.In order to fix this, I will need to parse the local go.mod file, or create some kind of parallel system to specify where things are. I shouldn't have to do that.
Proposals
go mod download -json
be replace aware. It could output additional entries specific to "replace" statements. Unfortunately, this might break tools relying on the current output format.go mod where
orgo mod download -where
that would simply output a module name and the path to the source of that module, including anything gathered from "replace" statements.The text was updated successfully, but these errors were encountered: