lnd/kvdb/kvdb_etcd.go
Oliver Gugger 0b4e03f5fc
multi: add golang 1.17 compatible build tags
With go 1.17 a change to the build flags was implemented:
https://go.googlesource.com/proposal/+/master/design/draft-gobuild.md

The formatter now automatically adds the forward-compatible build tag
format and the linter checks for them, so we need to include them in our
code.
2021-09-29 17:31:37 -07:00

23 lines
602 B
Go

//go:build kvdb_etcd
// +build kvdb_etcd
package kvdb
import (
"github.com/lightningnetwork/lnd/kvdb/etcd"
)
// TestBackend is conditionally set to etcd when the kvdb_etcd build tag is
// defined, allowing testing our database code with etcd backend.
const TestBackend = EtcdBackendName
// GetEtcdTestBackend creates an embedded etcd backend for testing
// storig the database at the passed path.
func StartEtcdTestBackend(path string, clientPort, peerPort uint16,
logFile string) (*etcd.Config, func(), error) {
return etcd.NewEmbeddedEtcdInstance(
path, clientPort, peerPort, logFile,
)
}