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
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 between dependencies and devDependencies 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:
I expected realize to be in my PATH, 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 and go.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 my dockerfile)
Is there a concept like npm's devDependencies with go 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:
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: