-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use modules to install a "dev dependency" for use before or during a build #29494
Labels
Comments
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I used
go get
to add a dependency that I'd like to use in development (in this case it is realize). This is conceptually similar to the distinction betweendependencies
anddevDependencies
in npm. This would apply to build tools, hot reloaders, linters, or any other package that I don't want compiled up into the application executable, but for use from the command line before the application starts up (or even before it builds). Here's my terminal session demonstrating the issue:What did you expect to see?
I expected
realize
to be in myPATH
, or available via./vendor/bin/realize
or similar, and to be added to any other developer's path when they install the dependencies from a fresh repo clone. This is especially important in Docker or CI.I also don't want
go mod tiny
to get rid of this dependency (or any other mechanism that may "prune" my dependencies by reading my source and determining which dependencies are referenced in the code).What did you see instead?
Instead, it listed the dependency and version in
go.mod
andgo.sum
as expected, but it's not clear (at least to me) how to reference the binary executable from the command line (e.g.CMD ["realize start"]
in mydockerfile
)Is there a concept like npm's
devDependencies
withgo modules
? I'm fairly new to go, and I know go modules are new as well, so hopefully this is just a simple misunderstanding on my end, but any clarity here would be extremely helpful.The text was updated successfully, but these errors were encountered: