From dfdc2bff8b5d46e37634c226df877efee270f6c4 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 7 Feb 2022 13:58:21 +0100 Subject: [PATCH] multi: run gosimports --- aezeed/cipherseed.go | 1 - autopilot/agent_constraints_test.go | 3 +-- autopilot/prefattach_test.go | 3 +-- brontide/noise.go | 5 ++--- channeldb/channel_test.go | 3 +-- channeldb/graph_cache.go | 1 - channeldb/migration/lnwire21/lnwire.go | 1 - channeldb/migration/lnwire21/onion_error.go | 3 +-- channeldb/waitingproof.go | 6 ++---- channeldb/waitingproof_test.go | 3 +-- cmd/lncli/invoicesrpc_active.go | 1 - cmd/lncli/main.go | 1 - contractcourt/breacharbiter.go | 1 - contractcourt/briefcase_test.go | 3 +-- input/script_utils.go | 3 +-- input/size_test.go | 3 +-- keychain/interface_test.go | 3 +-- lnd.go | 13 ++++++------ lnrpc/invoicesrpc/addinvoice.go | 1 - lnrpc/invoicesrpc/invoices_server.go | 9 ++++----- lnrpc/routerrpc/router_backend_test.go | 3 +-- lnrpc/routerrpc/router_server.go | 1 - lntest/mock/chainnotifier.go | 1 - lntest/mock/spendnotifier.go | 1 - lntest/mock/walletcontroller.go | 1 - lnwallet/btcwallet/config.go | 1 - lnwire/lnwire.go | 1 - lnwire/onion_error.go | 3 +-- macaroons/constraints.go | 1 - macaroons/constraints_test.go | 3 +-- macaroons/store.go | 3 +-- macaroons/store_test.go | 3 +-- monitoring/monitoring_off.go | 3 +-- monitoring/monitoring_on.go | 3 +-- peer/brontide.go | 1 - routing/chainview/interface_test.go | 1 - routing/localchans/manager_test.go | 12 +++++------ routing/notifications_test.go | 3 +-- routing/result_interpretation_test.go | 1 - routing/router.go | 1 - routing/router_test.go | 5 ++--- tools.go | 22 ++++++++++----------- watchtower/blob/justice_kit.go | 3 +-- zpay32/invoice_test.go | 1 - 44 files changed, 50 insertions(+), 95 deletions(-) diff --git a/aezeed/cipherseed.go b/aezeed/cipherseed.go index 4b97a5d72..a55bb5d3e 100644 --- a/aezeed/cipherseed.go +++ b/aezeed/cipherseed.go @@ -10,7 +10,6 @@ import ( "github.com/Yawning/aez" "github.com/kkdai/bstream" - "golang.org/x/crypto/scrypt" ) diff --git a/autopilot/agent_constraints_test.go b/autopilot/agent_constraints_test.go index 144107a15..aba3478bc 100644 --- a/autopilot/agent_constraints_test.go +++ b/autopilot/agent_constraints_test.go @@ -1,11 +1,10 @@ package autopilot import ( + prand "math/rand" "testing" "time" - prand "math/rand" - "github.com/btcsuite/btcutil" "github.com/lightningnetwork/lnd/lnwire" ) diff --git a/autopilot/prefattach_test.go b/autopilot/prefattach_test.go index 24934592b..12e3ecc36 100644 --- a/autopilot/prefattach_test.go +++ b/autopilot/prefattach_test.go @@ -3,12 +3,11 @@ package autopilot import ( "bytes" "io/ioutil" + prand "math/rand" "os" "testing" "time" - prand "math/rand" - "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcutil" "github.com/lightningnetwork/lnd/channeldb" diff --git a/brontide/noise.go b/brontide/noise.go index e8b71a877..f29c3a682 100644 --- a/brontide/noise.go +++ b/brontide/noise.go @@ -10,11 +10,10 @@ import ( "math" "time" - "golang.org/x/crypto/chacha20poly1305" - "golang.org/x/crypto/hkdf" - "github.com/btcsuite/btcd/btcec" "github.com/lightningnetwork/lnd/keychain" + "golang.org/x/crypto/chacha20poly1305" + "golang.org/x/crypto/hkdf" ) const ( diff --git a/channeldb/channel_test.go b/channeldb/channel_test.go index 044308f88..1d794ee47 100644 --- a/channeldb/channel_test.go +++ b/channeldb/channel_test.go @@ -8,8 +8,6 @@ import ( "runtime" "testing" - "github.com/stretchr/testify/require" - "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" @@ -22,6 +20,7 @@ import ( "github.com/lightningnetwork/lnd/lntest/channels" "github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/shachain" + "github.com/stretchr/testify/require" ) var ( diff --git a/channeldb/graph_cache.go b/channeldb/graph_cache.go index 2c3bc9024..3dc404525 100644 --- a/channeldb/graph_cache.go +++ b/channeldb/graph_cache.go @@ -5,7 +5,6 @@ import ( "sync" "github.com/btcsuite/btcutil" - "github.com/lightningnetwork/lnd/kvdb" "github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/routing/route" diff --git a/channeldb/migration/lnwire21/lnwire.go b/channeldb/migration/lnwire21/lnwire.go index ca0e449e5..2df3bbd4f 100644 --- a/channeldb/migration/lnwire21/lnwire.go +++ b/channeldb/migration/lnwire21/lnwire.go @@ -7,7 +7,6 @@ import ( "image/color" "io" "math" - "net" "github.com/btcsuite/btcd/btcec" diff --git a/channeldb/migration/lnwire21/onion_error.go b/channeldb/migration/lnwire21/onion_error.go index 35555e266..362ab48b0 100644 --- a/channeldb/migration/lnwire21/onion_error.go +++ b/channeldb/migration/lnwire21/onion_error.go @@ -2,13 +2,12 @@ package lnwire import ( "bufio" + "bytes" "crypto/sha256" "encoding/binary" "fmt" "io" - "bytes" - "github.com/davecgh/go-spew/spew" "github.com/go-errors/errors" "github.com/lightningnetwork/lnd/tlv" diff --git a/channeldb/waitingproof.go b/channeldb/waitingproof.go index 7bb53e179..c6b2b9df5 100644 --- a/channeldb/waitingproof.go +++ b/channeldb/waitingproof.go @@ -1,13 +1,11 @@ package channeldb import ( + "bytes" "encoding/binary" "fmt" - "sync" - "io" - - "bytes" + "sync" "github.com/go-errors/errors" "github.com/lightningnetwork/lnd/kvdb" diff --git a/channeldb/waitingproof_test.go b/channeldb/waitingproof_test.go index cb5b900f8..4fd49a991 100644 --- a/channeldb/waitingproof_test.go +++ b/channeldb/waitingproof_test.go @@ -1,9 +1,8 @@ package channeldb import ( - "testing" - "reflect" + "testing" "github.com/davecgh/go-spew/spew" "github.com/go-errors/errors" diff --git a/cmd/lncli/invoicesrpc_active.go b/cmd/lncli/invoicesrpc_active.go index b708e0f62..ee03d8679 100644 --- a/cmd/lncli/invoicesrpc_active.go +++ b/cmd/lncli/invoicesrpc_active.go @@ -6,7 +6,6 @@ package main import ( "encoding/hex" "fmt" - "strconv" "github.com/lightningnetwork/lnd/lnrpc/invoicesrpc" diff --git a/cmd/lncli/main.go b/cmd/lncli/main.go index a2b33f719..991184c12 100644 --- a/cmd/lncli/main.go +++ b/cmd/lncli/main.go @@ -18,7 +18,6 @@ import ( "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/macaroons" "github.com/urfave/cli" - "golang.org/x/term" "google.golang.org/grpc" "google.golang.org/grpc/credentials" diff --git a/contractcourt/breacharbiter.go b/contractcourt/breacharbiter.go index b1daa857d..954bdb718 100644 --- a/contractcourt/breacharbiter.go +++ b/contractcourt/breacharbiter.go @@ -14,7 +14,6 @@ import ( "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/davecgh/go-spew/spew" - "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/input" diff --git a/contractcourt/briefcase_test.go b/contractcourt/briefcase_test.go index 1bba09514..29d7edfbe 100644 --- a/contractcourt/briefcase_test.go +++ b/contractcourt/briefcase_test.go @@ -3,13 +3,12 @@ package contractcourt import ( "crypto/rand" "io/ioutil" + prand "math/rand" "os" "reflect" "testing" "time" - prand "math/rand" - "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/txscript" diff --git a/input/script_utils.go b/input/script_utils.go index b7b19bd21..659314d68 100644 --- a/input/script_utils.go +++ b/input/script_utils.go @@ -6,12 +6,11 @@ import ( "fmt" "math/big" - "golang.org/x/crypto/ripemd160" - "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" + "golang.org/x/crypto/ripemd160" ) var ( diff --git a/input/size_test.go b/input/size_test.go index b2d1e2bee..bddecdd7c 100644 --- a/input/size_test.go +++ b/input/size_test.go @@ -11,12 +11,11 @@ import ( "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" - "github.com/stretchr/testify/require" - "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/input" "github.com/lightningnetwork/lnd/keychain" "github.com/lightningnetwork/lnd/lnwallet" + "github.com/stretchr/testify/require" ) const ( diff --git a/keychain/interface_test.go b/keychain/interface_test.go index 3cd345e34..7ce7d59e8 100644 --- a/keychain/interface_test.go +++ b/keychain/interface_test.go @@ -15,10 +15,9 @@ import ( "github.com/btcsuite/btcwallet/waddrmgr" "github.com/btcsuite/btcwallet/wallet" "github.com/btcsuite/btcwallet/walletdb" + _ "github.com/btcsuite/btcwallet/walletdb/bdb" // Required in order to create the default database. "github.com/davecgh/go-spew/spew" "github.com/stretchr/testify/require" - - _ "github.com/btcsuite/btcwallet/walletdb/bdb" // Required in order to create the default database. ) var ( diff --git a/lnd.go b/lnd.go index 91d1ad00b..e1a0d1a7c 100644 --- a/lnd.go +++ b/lnd.go @@ -21,13 +21,6 @@ import ( "github.com/btcsuite/btcutil" proxy "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - "golang.org/x/crypto/acme/autocert" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/protobuf/encoding/protojson" - "gopkg.in/macaroon-bakery.v2/bakery" - "gopkg.in/macaroon.v2" - "github.com/lightningnetwork/lnd/autopilot" "github.com/lightningnetwork/lnd/build" "github.com/lightningnetwork/lnd/cert" @@ -44,6 +37,12 @@ import ( "github.com/lightningnetwork/lnd/tor" "github.com/lightningnetwork/lnd/walletunlocker" "github.com/lightningnetwork/lnd/watchtower" + "golang.org/x/crypto/acme/autocert" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/protobuf/encoding/protojson" + "gopkg.in/macaroon-bakery.v2/bakery" + "gopkg.in/macaroon.v2" ) const ( diff --git a/lnrpc/invoicesrpc/addinvoice.go b/lnrpc/invoicesrpc/addinvoice.go index 3bd6eaa36..25a57e8ff 100644 --- a/lnrpc/invoicesrpc/addinvoice.go +++ b/lnrpc/invoicesrpc/addinvoice.go @@ -14,7 +14,6 @@ import ( "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/davecgh/go-spew/spew" - "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/lntypes" "github.com/lightningnetwork/lnd/lnwire" diff --git a/lnrpc/invoicesrpc/invoices_server.go b/lnrpc/invoicesrpc/invoices_server.go index 8081e011b..5c0d71ac4 100644 --- a/lnrpc/invoicesrpc/invoices_server.go +++ b/lnrpc/invoicesrpc/invoices_server.go @@ -10,16 +10,15 @@ import ( "os" "path/filepath" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "gopkg.in/macaroon-bakery.v2/bakery" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lntypes" "github.com/lightningnetwork/lnd/macaroons" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "gopkg.in/macaroon-bakery.v2/bakery" ) const ( diff --git a/lnrpc/routerrpc/router_backend_test.go b/lnrpc/routerrpc/router_backend_test.go index 1b05d5f81..629a8ce6d 100644 --- a/lnrpc/routerrpc/router_backend_test.go +++ b/lnrpc/routerrpc/router_backend_test.go @@ -8,13 +8,12 @@ import ( "github.com/btcsuite/btcutil" "github.com/lightningnetwork/lnd/channeldb" + "github.com/lightningnetwork/lnd/lnrpc" "github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/record" "github.com/lightningnetwork/lnd/routing" "github.com/lightningnetwork/lnd/routing/route" "github.com/stretchr/testify/require" - - "github.com/lightningnetwork/lnd/lnrpc" ) const ( diff --git a/lnrpc/routerrpc/router_server.go b/lnrpc/routerrpc/router_server.go index e1b34368e..ea4fb8359 100644 --- a/lnrpc/routerrpc/router_server.go +++ b/lnrpc/routerrpc/router_server.go @@ -20,7 +20,6 @@ import ( "github.com/lightningnetwork/lnd/macaroons" "github.com/lightningnetwork/lnd/routing" "github.com/lightningnetwork/lnd/routing/route" - "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/lntest/mock/chainnotifier.go b/lntest/mock/chainnotifier.go index 185d15cd2..b7c9377c2 100644 --- a/lntest/mock/chainnotifier.go +++ b/lntest/mock/chainnotifier.go @@ -3,7 +3,6 @@ package mock import ( "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" - "github.com/lightningnetwork/lnd/chainntnfs" ) diff --git a/lntest/mock/spendnotifier.go b/lntest/mock/spendnotifier.go index ced93f251..04c861d91 100644 --- a/lntest/mock/spendnotifier.go +++ b/lntest/mock/spendnotifier.go @@ -4,7 +4,6 @@ import ( "sync" "github.com/btcsuite/btcd/wire" - "github.com/lightningnetwork/lnd/chainntnfs" ) diff --git a/lntest/mock/walletcontroller.go b/lntest/mock/walletcontroller.go index f524695a5..3e9db935c 100644 --- a/lntest/mock/walletcontroller.go +++ b/lntest/mock/walletcontroller.go @@ -15,7 +15,6 @@ import ( "github.com/btcsuite/btcwallet/waddrmgr" "github.com/btcsuite/btcwallet/wallet/txauthor" "github.com/btcsuite/btcwallet/wtxmgr" - "github.com/lightningnetwork/lnd/lnwallet" "github.com/lightningnetwork/lnd/lnwallet/chainfee" ) diff --git a/lnwallet/btcwallet/config.go b/lnwallet/btcwallet/config.go index b9c642c5d..45abdafce 100644 --- a/lnwallet/btcwallet/config.go +++ b/lnwallet/btcwallet/config.go @@ -6,7 +6,6 @@ import ( "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/wire" - "github.com/btcsuite/btcwallet/chain" "github.com/btcsuite/btcwallet/wallet" ) diff --git a/lnwire/lnwire.go b/lnwire/lnwire.go index 20edcbab4..f40cdbb22 100644 --- a/lnwire/lnwire.go +++ b/lnwire/lnwire.go @@ -7,7 +7,6 @@ import ( "image/color" "io" "math" - "net" "github.com/btcsuite/btcd/btcec" diff --git a/lnwire/onion_error.go b/lnwire/onion_error.go index 60d61184d..593f58e3d 100644 --- a/lnwire/onion_error.go +++ b/lnwire/onion_error.go @@ -2,13 +2,12 @@ package lnwire import ( "bufio" + "bytes" "crypto/sha256" "encoding/binary" "fmt" "io" - "bytes" - "github.com/davecgh/go-spew/spew" "github.com/go-errors/errors" "github.com/lightningnetwork/lnd/tlv" diff --git a/macaroons/constraints.go b/macaroons/constraints.go index bd8741006..480339b67 100644 --- a/macaroons/constraints.go +++ b/macaroons/constraints.go @@ -9,7 +9,6 @@ import ( "time" "google.golang.org/grpc/peer" - "gopkg.in/macaroon-bakery.v2/bakery/checkers" macaroon "gopkg.in/macaroon.v2" ) diff --git a/macaroons/constraints_test.go b/macaroons/constraints_test.go index 6e1e243d1..db3b73ab8 100644 --- a/macaroons/constraints_test.go +++ b/macaroons/constraints_test.go @@ -6,9 +6,8 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - "github.com/lightningnetwork/lnd/macaroons" + "github.com/stretchr/testify/require" macaroon "gopkg.in/macaroon.v2" ) diff --git a/macaroons/store.go b/macaroons/store.go index 7b0c33643..867fb3a30 100644 --- a/macaroons/store.go +++ b/macaroons/store.go @@ -8,10 +8,9 @@ import ( "io" "sync" - "github.com/lightningnetwork/lnd/kvdb" - "github.com/btcsuite/btcwallet/snacl" "github.com/btcsuite/btcwallet/walletdb" + "github.com/lightningnetwork/lnd/kvdb" ) const ( diff --git a/macaroons/store_test.go b/macaroons/store_test.go index 8dfe9e3a8..9eac2912d 100644 --- a/macaroons/store_test.go +++ b/macaroons/store_test.go @@ -7,10 +7,9 @@ import ( "path" "testing" + "github.com/btcsuite/btcwallet/snacl" "github.com/lightningnetwork/lnd/kvdb" "github.com/lightningnetwork/lnd/macaroons" - - "github.com/btcsuite/btcwallet/snacl" "github.com/stretchr/testify/require" ) diff --git a/monitoring/monitoring_off.go b/monitoring/monitoring_off.go index 8e2a1c2be..cb8ca4543 100644 --- a/monitoring/monitoring_off.go +++ b/monitoring/monitoring_off.go @@ -6,9 +6,8 @@ package monitoring import ( "fmt" - "google.golang.org/grpc" - "github.com/lightningnetwork/lnd/lncfg" + "google.golang.org/grpc" ) // GetPromInterceptors returns the set of interceptors for Prometheus diff --git a/monitoring/monitoring_on.go b/monitoring/monitoring_on.go index 78a0f7e22..97d5852ad 100644 --- a/monitoring/monitoring_on.go +++ b/monitoring/monitoring_on.go @@ -7,11 +7,10 @@ import ( "net/http" "sync" - "google.golang.org/grpc" - grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/lightningnetwork/lnd/lncfg" "github.com/prometheus/client_golang/prometheus/promhttp" + "google.golang.org/grpc" ) var started sync.Once diff --git a/peer/brontide.go b/peer/brontide.go index 9595bf285..fb6335801 100644 --- a/peer/brontide.go +++ b/peer/brontide.go @@ -16,7 +16,6 @@ import ( "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" "github.com/davecgh/go-spew/spew" - "github.com/lightningnetwork/lnd/buffer" "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/channeldb" diff --git a/routing/chainview/interface_test.go b/routing/chainview/interface_test.go index 9cf8ed888..c1c886c0b 100644 --- a/routing/chainview/interface_test.go +++ b/routing/chainview/interface_test.go @@ -24,7 +24,6 @@ import ( "github.com/btcsuite/btcwallet/chain" "github.com/btcsuite/btcwallet/walletdb" _ "github.com/btcsuite/btcwallet/walletdb/bdb" // Required to register the boltdb walletdb implementation. - "github.com/lightninglabs/neutrino" "github.com/lightningnetwork/lnd/blockcache" "github.com/lightningnetwork/lnd/channeldb" diff --git a/routing/localchans/manager_test.go b/routing/localchans/manager_test.go index 40f05f2fa..a11b32c85 100644 --- a/routing/localchans/manager_test.go +++ b/routing/localchans/manager_test.go @@ -3,19 +3,17 @@ package localchans import ( "testing" - "github.com/lightningnetwork/lnd/kvdb" - "github.com/lightningnetwork/lnd/lnrpc" - "github.com/lightningnetwork/lnd/lnwire" - "github.com/stretchr/testify/require" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcutil" - "github.com/btcsuite/btcd/wire" + "github.com/btcsuite/btcutil" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/discovery" "github.com/lightningnetwork/lnd/htlcswitch" + "github.com/lightningnetwork/lnd/kvdb" + "github.com/lightningnetwork/lnd/lnrpc" + "github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/routing" + "github.com/stretchr/testify/require" ) // TestManager tests that the local channel manager properly propagates fee diff --git a/routing/notifications_test.go b/routing/notifications_test.go index c63aa66e4..63546e5bf 100644 --- a/routing/notifications_test.go +++ b/routing/notifications_test.go @@ -4,13 +4,12 @@ import ( "bytes" "fmt" "image/color" + prand "math/rand" "net" "sync" "testing" "time" - prand "math/rand" - "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" diff --git a/routing/result_interpretation_test.go b/routing/result_interpretation_test.go index 954f07981..b9fcc68d1 100644 --- a/routing/result_interpretation_test.go +++ b/routing/result_interpretation_test.go @@ -6,7 +6,6 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/lightningnetwork/lnd/lnwire" - "github.com/lightningnetwork/lnd/routing/route" ) diff --git a/routing/router.go b/routing/router.go index 7da746222..7d9d482eb 100644 --- a/routing/router.go +++ b/routing/router.go @@ -15,7 +15,6 @@ import ( "github.com/btcsuite/btcutil" "github.com/davecgh/go-spew/spew" "github.com/go-errors/errors" - sphinx "github.com/lightningnetwork/lightning-onion" "github.com/lightningnetwork/lnd/amp" "github.com/lightningnetwork/lnd/batch" diff --git a/routing/router_test.go b/routing/router_test.go index 4a3b5bcee..5fb39d0fa 100644 --- a/routing/router_test.go +++ b/routing/router_test.go @@ -15,9 +15,6 @@ import ( "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/davecgh/go-spew/spew" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/channeldb" "github.com/lightningnetwork/lnd/clock" @@ -29,6 +26,8 @@ import ( "github.com/lightningnetwork/lnd/record" "github.com/lightningnetwork/lnd/routing/route" "github.com/lightningnetwork/lnd/zpay32" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" ) var uniquePaymentID uint64 = 1 // to be used atomically diff --git a/tools.go b/tools.go index 6f9489ac3..f794b5f5b 100644 --- a/tools.go +++ b/tools.go @@ -3,19 +3,19 @@ package lnd +// This file 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, the specific btcd 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. +// +// The other imports represent our build tools. Instead of defining a commit we +// want to use for those golang based tools, we use the go mod versioning system +// to unify the way we manage dependencies. So we define our build tool +// dependencies here and pin the version in go.mod. 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" - - // Instead of defining a commit we want to use for those golang based - // tools, we use the go mod versioning system to unify the way we manage - // dependencies. So we define our build tool dependencies here and pin - // the version in go.mod. _ "github.com/dvyukov/go-fuzz/go-fuzz" _ "github.com/dvyukov/go-fuzz/go-fuzz-build" _ "github.com/dvyukov/go-fuzz/go-fuzz-dep" diff --git a/watchtower/blob/justice_kit.go b/watchtower/blob/justice_kit.go index 20c44cefc..d80237e2c 100644 --- a/watchtower/blob/justice_kit.go +++ b/watchtower/blob/justice_kit.go @@ -8,12 +8,11 @@ import ( "fmt" "io" - "golang.org/x/crypto/chacha20poly1305" - "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/txscript" "github.com/lightningnetwork/lnd/input" "github.com/lightningnetwork/lnd/lnwire" + "golang.org/x/crypto/chacha20poly1305" ) const ( diff --git a/zpay32/invoice_test.go b/zpay32/invoice_test.go index 14d2401a3..c9f7256f7 100644 --- a/zpay32/invoice_test.go +++ b/zpay32/invoice_test.go @@ -18,7 +18,6 @@ import ( "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/lightningnetwork/lnd/lnwire" - litecoinCfg "github.com/ltcsuite/ltcd/chaincfg" )