lnd: fix issues reported by golint+govet

github.com/lightningnetwork/lnd  master ✗

                                           0m ◒
▶ golint
htlcswitch.go:292:4: should replace numUpdates += 1 with numUpdates++
htlcswitch.go:554:6: var onionId should be onionID
htlcswitch.go:629:7: var onionId should be onionID
lnd_test.go:133:1: context.Context should be the first parameter of a
function
lnd_test.go:177:1: context.Context should be the first parameter of a
function
networktest.go:84:2: struct field nodeId should be nodeID
peer.go:1704:16: should omit 2nd value from range; this loop is
equivalent to `for invoice := range ...`
rpcserver.go:57:6: func newRpcServer should be newRPCServer

github.com/lightningnetwork/lnd  master ✗

                                        9m ⚑ ◒  ⍉
▶ go vet
features.go:12: github.com/lightningnetwork/lnd/lnwire.Feature
composite literal uses unkeyed fields
fundingmanager.go:380: no formatting directive in Errorf call
exit status 1
This commit is contained in:
Olaoluwa Osuntokun committed 2017-02-22 14:58:37 -08:00
1 parent 6c81dfad61
commit e910b12d33
8 files changed
+50 -49

No files matched your search

+6 -6
View File
@@ -81,7 +81,7 @@ type lightningNode struct {
p2pAddr string
rpcCert []byte
nodeId int
nodeID int
// PubKey is the serialized compressed identity public key of the node.
// This field will only be populated once the node itself has been
@@ -131,7 +131,7 @@ func newLightningNode(rpcConfig *btcrpcclient.ConnConfig, lndArgs []string) (*li
p2pAddr: net.JoinHostPort("127.0.0.1", strconv.Itoa(cfg.PeerPort)),
rpcAddr: net.JoinHostPort("127.0.0.1", strconv.Itoa(cfg.RPCPort)),
rpcCert: rpcConfig.Certificates,
nodeId: nodeNum,
nodeID: nodeNum,
processExit: make(chan struct{}),
extraArgs: lndArgs,
}, nil
@@ -188,7 +188,7 @@ func (l *lightningNode) start(lndError chan error) error {
}()
pid, err := os.Create(filepath.Join(l.cfg.DataDir,
fmt.Sprintf("%v.pid", l.nodeId)))
fmt.Sprintf("%v.pid", l.nodeID)))
if err != nil {
return err
}
@@ -358,8 +358,8 @@ func (n *networkHarness) InitializeSeedNodes(r *rpctest.Harness, lndArgs []strin
return err
}
n.activeNodes[n.Alice.nodeId] = n.Alice
n.activeNodes[n.Bob.nodeId] = n.Bob
n.activeNodes[n.Alice.nodeID] = n.Alice
n.activeNodes[n.Bob.nodeID] = n.Bob
return err
}
@@ -522,7 +522,7 @@ func (n *networkHarness) NewNode(extraArgs []string) (*lightningNode, error) {
return nil, err
}
n.activeNodes[node.nodeId] = node
n.activeNodes[node.nodeID] = node
return node, nil
}