build: switch from dep to go modules #2239
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR, we switch from using
dep
for our dependency management to using go modules instead. This change is made possible by #1892. As a result of these set of changes,lnd
no longer needs to live in the$GOPATH
! Instead, it can now live anywhere on ones file system. Go modules will automatically be activated if it detects a build happening outside the$GOPATH
. In order to activate support within the$GOPATH
, the following environment variable needs to be set when building:GO111MODULE=on
. Once go 1.12 is released, this will no longer be required however.All relevant documentation has been updated to reflect the new building commands (no more
dep
is it really). We also update themakefile
to use the environment variable as necessary, and read commit hashes fromgo.sum
instead ofGopkg.lock
. Now that we have build caching, we can also safely cache the directory that Go uses to store the modules information. This should further speed up our builds.