multi: fix linter issues

This commit is contained in:
Oliver Gugger 2022-10-15 09:04:07 +02:00
parent 843a3fc86a
commit c3cad46aa2
No known key found for this signature in database
GPG key ID: 8E4256593F177720
10 changed files with 14 additions and 29 deletions

View file

@ -6,7 +6,7 @@ import (
"os"
"github.com/jessevdk/go-flags"
"github.com/lightninglabs/lightning-terminal"
terminal "github.com/lightninglabs/lightning-terminal"
)
// main starts the lightning-terminal application.

View file

@ -758,10 +758,12 @@ func buildTLSConfigForHttp2(config *Config) (*tls.Config, error) {
log.Infof("Listening for Let's Encrypt challenges on "+
"%v", config.LetsEncryptListen)
err := http.ListenAndServe(
config.LetsEncryptListen,
manager.HTTPHandler(nil),
)
srv := &http.Server{
Addr: config.LetsEncryptListen,
ReadHeaderTimeout: 3 * time.Second,
Handler: manager.HTTPHandler(nil),
}
err := srv.ListenAndServe()
if err != nil {
log.Errorf("Error starting Let's Encrypt "+
"HTTP listener on port 80: %v", err)

View file

@ -495,7 +495,7 @@ func runUIPasswordCheck(t *testing.T, hostPort, tlsCertPath, uiPassword string,
// provide a dummy macaroon but still the UI password must be
// correct to pass.
ctxm = uiPasswordContext(ctxt, uiPassword, true)
resp, err = makeRequest(ctxm, rawConn)
_, err = makeRequest(ctxm, rawConn)
require.Error(t, err)
require.Contains(

View file

@ -728,7 +728,6 @@ func (hn *HarnessNode) waitForState(conn grpc.ClientConnInterface,
}()
select {
case <-started:
case err = <-errChan:
@ -888,7 +887,6 @@ func (hn *HarnessNode) waitTillServerStarted() error {
return nil
}
}
}
// initLightningClient constructs the grpc LightningClient from the given client
@ -1258,7 +1256,6 @@ func (hn *HarnessNode) lightningNetworkWatcher() {
for {
select {
// A new graph update has just been received, so we'll examine
// the current set of registered clients to see if we can
// dispatch any requests.
@ -1779,7 +1776,6 @@ func (hn *HarnessNode) getChannelPolicies(include bool) policyUpdateMap {
policyUpdates := policyUpdateMap{}
for _, e := range graph.Edges {
policies := policyUpdates[e.ChanPoint]
// If the map[op] is nil, we need to initialize the map first.

View file

@ -94,15 +94,8 @@ func TestLightningTerminal(t *testing.T) {
// case should naturally as a result and we log the server error here to
// help debug.
go func() {
for {
select {
case err, more := <-litdHarness.ProcessErrors():
if !more {
return
}
ht.Logf("litd finished with error (stderr):\n%v",
err)
}
for err := range litdHarness.ProcessErrors() {
ht.Logf("litd finished with error (stderr):\n%v", err)
}
}()

View file

@ -234,6 +234,7 @@ out:
if aliceResp.ConfirmedBalance == expectedBalance &&
bobResp.ConfirmedBalance == expectedBalance {
break out
}
case <-balanceTimeout:
@ -259,7 +260,6 @@ func (n *NetworkHarness) TearDown() error {
func (n *NetworkHarness) Stop() {
close(n.lndErrorChan)
close(n.quit)
}
// NewNode initializes a new HarnessNode.
@ -420,7 +420,6 @@ func (n *NetworkHarness) EnsureConnected(t *testing.T, a, b *HarnessNode) {
predErr = err
return false
}
}, lntest.DefaultTimeout)
if err != nil {
return fmt.Errorf("connection not succeeded within 15 "+
@ -959,6 +958,7 @@ func (n *NetworkHarness) CloseChannel(lnNode *HarnessNode,
// not.
filterChannel := func(node *HarnessNode,
op wire.OutPoint) (*lnrpc.Channel, error) {
listResp, err := node.ListChannels(ctx, listReq)
if err != nil {
return nil, err

View file

@ -79,7 +79,6 @@ func (h *harnessTest) Fatalf(format string, a ...interface{}) {
// RunTestCase executes a harness test case. Any errors or panics will be
// represented as fatal.
func (h *harnessTest) RunTestCase(testCase *testCase) {
h.testCase = testCase
defer func() {
h.testCase = nil

View file

@ -81,7 +81,6 @@ func syncVersions(db *bbolt.DB) error {
"db_version=%v", latestDBVersion, currentVersion)
switch {
// If the database reports a higher version that we are aware of, the
// user is probably trying to revert to a prior version of lnd. We fail
// here to prevent reversions and unintended corruption.

View file

@ -28,7 +28,7 @@ const (
// typeMacaroon is no longer used, but we leave it defined for backwards
// compatibility.
typeMacaroon tlv.Type = 8
typeMacaroon tlv.Type = 8 // nolint
typeMacPerms tlv.Type = 1
typeMacCaveats tlv.Type = 2
@ -182,7 +182,6 @@ func DeserializeSession(r io.Reader) (*Session, error) {
// macaroonRecipeEncoder is a custom TLV encoder for a MacaroonRecipe record.
func macaroonRecipeEncoder(w io.Writer, val interface{}, buf *[8]byte) error {
if v, ok := val.(*MacaroonRecipe); ok {
var recipeTLVBytes bytes.Buffer
tlvStream, err := tlv.NewStream(
tlv.MakeDynamicRecord(
@ -225,7 +224,6 @@ func macaroonRecipeDecoder(r io.Reader, val interface{}, buf *[8]byte,
l uint64) error {
if v, ok := val.(*MacaroonRecipe); ok {
// Using this information, we'll create a new limited
// reader that'll return an EOF once the end has been
// reached so the stream stops consuming bytes.

View file

@ -13,9 +13,7 @@ import (
)
var (
testRootKey = []byte("54321")
testID = []byte("dummyId")
testLocation = "lnd"
testRootKey = []byte("54321")
perms = []bakery.Op{
{