multi: run gosimports

This commit is contained in:
Oliver Gugger 2022-02-07 13:58:21 +01:00
parent d1b512ff92
commit dfdc2bff8b
No known key found for this signature in database
GPG key ID: 8E4256593F177720
44 changed files with 50 additions and 95 deletions

View file

@ -10,7 +10,6 @@ import (
"github.com/Yawning/aez"
"github.com/kkdai/bstream"
"golang.org/x/crypto/scrypt"
)

View file

@ -1,11 +1,10 @@
package autopilot
import (
prand "math/rand"
"testing"
"time"
prand "math/rand"
"github.com/btcsuite/btcutil"
"github.com/lightningnetwork/lnd/lnwire"
)

View file

@ -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"

View file

@ -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 (

View file

@ -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 (

View file

@ -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"

View file

@ -7,7 +7,6 @@ import (
"image/color"
"io"
"math"
"net"
"github.com/btcsuite/btcd/btcec"

View file

@ -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"

View file

@ -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"

View file

@ -1,9 +1,8 @@
package channeldb
import (
"testing"
"reflect"
"testing"
"github.com/davecgh/go-spew/spew"
"github.com/go-errors/errors"

View file

@ -6,7 +6,6 @@ package main
import (
"encoding/hex"
"fmt"
"strconv"
"github.com/lightningnetwork/lnd/lnrpc/invoicesrpc"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

13
lnd.go
View file

@ -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 (

View file

@ -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"

View file

@ -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 (

View file

@ -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 (

View file

@ -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"

View file

@ -3,7 +3,6 @@ package mock
import (
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/chainntnfs"
)

View file

@ -4,7 +4,6 @@ import (
"sync"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/chainntnfs"
)

View file

@ -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"
)

View file

@ -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"
)

View file

@ -7,7 +7,6 @@ import (
"image/color"
"io"
"math"
"net"
"github.com/btcsuite/btcd/btcec"

View file

@ -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"

View file

@ -9,7 +9,6 @@ import (
"time"
"google.golang.org/grpc/peer"
"gopkg.in/macaroon-bakery.v2/bakery/checkers"
macaroon "gopkg.in/macaroon.v2"
)

View file

@ -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"
)

View file

@ -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 (

View file

@ -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"
)

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -6,7 +6,6 @@ import (
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing/route"
)

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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 (

View file

@ -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"
)