mod+tools: pin down build flag dependent go.sum entry

This is a workaround to fix the windows build. Apparently there was a
change in go 1.16 in how the go.sum entries are calculated. Dependencies
that aren't directly depended on are stripped. Because we need this
indirect windows dependency for the integration tests, we add a
workaround that makes sure the entry is kept in go.sum.
This commit is contained in:
Oliver Gugger
2021-04-23 14:15:33 +02:00
parent 585a78dbc7
commit 364421dced
2 changed files with 14 additions and 0 deletions

13
tools.go Normal file
View File

@@ -0,0 +1,13 @@
// +build tools
package lnd
import (
// This is a workaround to make sure go mod keeps around the btcd
// dependencies in the go.sum file that we only use during integration
// tests and only for certain operating systems. For example, this
// specific import makes sure the indirect dependency
// github.com/btcsuite/winsvc is kept in the go.sum file. Because of the
// build tag, this dependency never ends up in the final lnd binary.
_ "github.com/btcsuite/btcd"
)