all: add whitespace linter (#25312)

* golangci: typo

Signed-off-by: Delweng <delweng@gmail.com>

* golangci: add whietspace

Signed-off-by: Delweng <delweng@gmail.com>

* *: rm whitesapce using golangci-lint

Signed-off-by: Delweng <delweng@gmail.com>

* cmd/puppeth: revert accidental resurrection

Co-authored-by: Péter Szilágyi <peterke@gmail.com>
This commit is contained in:
Delweng
2022-07-25 13:14:03 +03:00
committed by GitHub
co-authored by Péter Szilágyi
parent 6c4e5d06e7
commit b196ad1c16
90 changed files with 12 additions and 164 deletions
-1
View File
@@ -367,7 +367,6 @@ func (s *Server) StopMocker(w http.ResponseWriter, req *http.Request) {
// GetMockerList returns a list of available mockers
func (s *Server) GetMockers(w http.ResponseWriter, req *http.Request) {
list := GetMockerList()
s.JSON(w, http.StatusOK, list)
}
-2
View File
@@ -489,7 +489,6 @@ func (t *expectEvents) expect(events ...*Event) {
}
switch expected.Type {
case EventTypeNode:
if event.Node == nil {
t.Fatal("expected event.Node to be set")
@@ -514,7 +513,6 @@ func (t *expectEvents) expect(events ...*Event) {
if event.Conn.Up != expected.Conn.Up {
t.Fatalf("expected conn event %d to have up=%t, got up=%t", i, expected.Conn.Up, event.Conn.Up)
}
}
i++
-1
View File
@@ -157,7 +157,6 @@ func probabilistic(net *Network, quit chan struct{}, nodeCount int) {
}
wg.Wait()
}
}
//connect nodeCount number of nodes in a ring
-4
View File
@@ -235,7 +235,6 @@ func (net *Network) watchPeerEvents(id enode.ID, events chan *p2p.PeerEvent, sub
}
peer := event.Peer
switch event.Type {
case p2p.PeerEventTypeAdd:
net.DidConnect(id, peer)
@@ -247,7 +246,6 @@ func (net *Network) watchPeerEvents(id enode.ID, events chan *p2p.PeerEvent, sub
case p2p.PeerEventTypeMsgRecv:
net.DidReceive(peer, id, event.Protocol, *event.MsgCode)
}
case err := <-sub.Err():
@@ -927,7 +925,6 @@ func (net *Network) snapshot(addServices []string, removeServices []string) (*Sn
if !haveSvc {
cleanedServices = append(cleanedServices, svc)
}
}
snap.Nodes[i].Node.Config.Lifecycles = cleanedServices
}
@@ -1021,7 +1018,6 @@ func (net *Network) Load(snap *Snapshot) error {
// Start connecting.
for _, conn := range snap.Conns {
if !net.GetNode(conn.One).Up() || !net.GetNode(conn.Other).Up() {
//in this case, at least one of the nodes of a connection is not up,
//so it would result in the snapshot `Load` to fail
-3
View File
@@ -36,7 +36,6 @@ import (
// Tests that a created snapshot with a minimal service only contains the expected connections
// and that a network when loaded with this snapshot only contains those same connections
func TestSnapshot(t *testing.T) {
// PART I
// create snapshot from ring network
@@ -204,7 +203,6 @@ OuterTwo:
t.Fatal(ctx.Err())
case ev := <-evC:
if ev.Type == EventTypeConn && !ev.Control {
// fail on any disconnect
if !ev.Conn.Up {
t.Fatalf("unexpected disconnect: %v -> %v", ev.Conn.One, ev.Conn.Other)
@@ -693,7 +691,6 @@ func BenchmarkMinimalService(b *testing.B) {
}
func benchmarkMinimalServiceTmp(b *testing.B) {
// stop timer to discard setup time pollution
args := strings.Split(b.Name(), "/")
nodeCount, err := strconv.ParseInt(args[2], 10, 16)