From c1ea6b167cb07ad58bd7ca129eab602aa0c29ab9 Mon Sep 17 00:00:00 2001 From: Brendan LE GLAUNEC Date: Mon, 5 Feb 2018 10:49:48 +0100 Subject: [PATCH] Fix misspelling and format using the -s option --- attack.go | 4 +- discover_test.go | 60 +++++++++++----------- server/adaptor/websocket/gorillaFactory.go | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/attack.go b/attack.go index 9f2890b..aba41d2 100644 --- a/attack.go +++ b/attack.go @@ -177,7 +177,7 @@ func AttackCredentials(targets []Stream, credentials Credentials, timeout time.D } attackResults := []Stream{} - for _ = range targets { + for range targets { attackResults = append(attackResults, <-attacks) } @@ -217,7 +217,7 @@ func AttackRoute(targets []Stream, routes Routes, timeout time.Duration, log boo } attackResults := []Stream{} - for _ = range targets { + for range targets { attackResults = append(attackResults, <-attacks) } diff --git a/discover_test.go b/discover_test.go index 7abbc8c..a76e07e 100644 --- a/discover_test.go +++ b/discover_test.go @@ -120,14 +120,14 @@ func TestNmapParseResults(t *testing.T) { expectedStreams: []Stream{validStream1, validStream2}, streamsXML: &nmapResult{ Hosts: []host{ - host{ + { Address: address{ Addr: validStream1.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: validStream1.Port, State: state{ State: "open", @@ -140,14 +140,14 @@ func TestNmapParseResults(t *testing.T) { }, }, }, - host{ + { Address: address{ Addr: validStream2.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: validStream2.Port, State: state{ State: "open", @@ -171,14 +171,14 @@ func TestNmapParseResults(t *testing.T) { expectedStreams: []Stream{invalidStreamNoPort, invalidStreamNoAddress}, streamsXML: &nmapResult{ Hosts: []host{ - host{ + { Address: address{ Addr: invalidStreamNoAddress.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: invalidStreamNoAddress.Port, State: state{ State: "open", @@ -191,14 +191,14 @@ func TestNmapParseResults(t *testing.T) { }, }, }, - host{ + { Address: address{ Addr: invalidStreamNoPort.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: invalidStreamNoPort.Port, State: state{ State: "open", @@ -225,14 +225,14 @@ func TestNmapParseResults(t *testing.T) { expectedStreams: []Stream{}, streamsXML: &nmapResult{ Hosts: []host{ - host{ + { Address: address{ Addr: "Camera with closed ports", AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: 0, State: state{ State: "closed", @@ -245,7 +245,7 @@ func TestNmapParseResults(t *testing.T) { }, }, }, - host{ + { Address: address{ Addr: "Camera with closed ports", AddrType: "ipv4", @@ -365,14 +365,14 @@ func TestDiscover(t *testing.T) { expectedStreams: []Stream{validStream1, validStream2}, streamsXML: &nmapResult{ Hosts: []host{ - host{ + { Address: address{ Addr: validStream1.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: validStream1.Port, State: state{ State: "open", @@ -385,14 +385,14 @@ func TestDiscover(t *testing.T) { }, }, }, - host{ + { Address: address{ Addr: validStream2.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: validStream2.Port, State: state{ State: "open", @@ -419,14 +419,14 @@ func TestDiscover(t *testing.T) { expectedStreams: []Stream{}, streamsXML: &nmapResult{ Hosts: []host{ - host{ + { Address: address{ Addr: validStream1.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: validStream1.Port, State: state{ State: "open", @@ -439,14 +439,14 @@ func TestDiscover(t *testing.T) { }, }, }, - host{ + { Address: address{ Addr: validStream2.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: validStream2.Port, State: state{ State: "open", @@ -476,14 +476,14 @@ func TestDiscover(t *testing.T) { expectedStreams: []Stream{validStream1, validStream2}, streamsXML: &nmapResult{ Hosts: []host{ - host{ + { Address: address{ Addr: validStream1.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: validStream1.Port, State: state{ State: "open", @@ -496,14 +496,14 @@ func TestDiscover(t *testing.T) { }, }, }, - host{ + { Address: address{ Addr: validStream2.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: validStream2.Port, State: state{ State: "open", @@ -532,14 +532,14 @@ func TestDiscover(t *testing.T) { expectedStreams: []Stream{invalidStreamNoPort, invalidStreamNoAddress}, streamsXML: &nmapResult{ Hosts: []host{ - host{ + { Address: address{ Addr: invalidStreamNoAddress.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: invalidStreamNoAddress.Port, State: state{ State: "open", @@ -552,14 +552,14 @@ func TestDiscover(t *testing.T) { }, }, }, - host{ + { Address: address{ Addr: invalidStreamNoPort.Address, AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: invalidStreamNoPort.Port, State: state{ State: "open", @@ -596,14 +596,14 @@ func TestDiscover(t *testing.T) { expectedStreams: []Stream{}, streamsXML: &nmapResult{ Hosts: []host{ - host{ + { Address: address{ Addr: "Camera with closed ports", AddrType: "ipv4", }, Ports: ports{ Ports: []port{ - port{ + { PortID: 0, State: state{ State: "closed", @@ -616,7 +616,7 @@ func TestDiscover(t *testing.T) { }, }, }, - host{ + { Address: address{ Addr: "Camera with closed ports", AddrType: "ipv4", diff --git a/server/adaptor/websocket/gorillaFactory.go b/server/adaptor/websocket/gorillaFactory.go index a32f5b9..2504fc7 100644 --- a/server/adaptor/websocket/gorillaFactory.go +++ b/server/adaptor/websocket/gorillaFactory.go @@ -68,7 +68,7 @@ func (gf *GorillaFactory) NewIncomingWebSocket(w http.ResponseWriter, req *http. return g, nil } -// NewWebSocket attemps to connect to a ws server using Gorilla library +// NewWebSocket attempts to connect to a ws server using Gorilla library func (gf *GorillaFactory) NewWebSocket(url string) (adaptor.WebSocket, error) { fmt.Printf("opening new ws connection to %v\n", url)