Skip to content

Commit cc9b63c

Browse files
committed
fix: runned gofmt
1 parent 5f755e2 commit cc9b63c

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

libs/checker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package libs
22

33
import (
44
"fmt"
5+
"github.com/google/gopacket"
6+
"github.com/google/gopacket/layers"
57
"os"
68
"os/exec"
79
"os/user"
810
"regexp"
911
"strconv"
1012
"strings"
11-
"github.com/google/gopacket"
12-
"github.com/google/gopacket/layers"
1313
)
1414

1515
// Check if the main layer is a beacon

libs/jsonreader/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ type RadarConf struct {
1313

1414
type Apache2Conf struct {
1515
InfoGrabbed string `json:"Info-Grabbed"`
16-
LOGFile string `json:"LOG-File"`
16+
LOGFile string `json:"LOG-File"`
1717
}

libs/libs.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@ import (
44
"bytes"
55
"encoding/binary"
66
"fmt"
7-
"math/rand"
8-
"net"
9-
"os"
10-
"os/exec"
11-
"reflect"
12-
"sort"
13-
"strconv"
14-
"strings"
15-
"time"
167
"gapcast/libs/RadarRSSI"
178
"gapcast/libs/RadarRSSI/libs"
189
"gapcast/libs/jsonreader"
@@ -23,6 +14,15 @@ import (
2314
"github.com/google/gopacket/pcap"
2415
"github.com/mattn/go-isatty"
2516
"golang.org/x/exp/slices"
17+
"math/rand"
18+
"net"
19+
"os"
20+
"os/exec"
21+
"reflect"
22+
"sort"
23+
"strconv"
24+
"strings"
25+
"time"
2626
)
2727

2828
var (
@@ -136,7 +136,7 @@ func ParseChannels(ch string, g5 bool, g5g24 bool) ([]int, string) {
136136
if g5 {
137137
if !slices.Contains(G5channels[:], channel) {
138138
return nil, fmt.Sprintf("Channel %s is invalid for 5 GHz.", channelStr)
139-
}
139+
}
140140
} else {
141141
if !slices.Contains(G24channels[:], channel) {
142142
return nil, fmt.Sprintf("Channel %s is invalid for 2.4 GHz.", channelStr)
@@ -493,7 +493,7 @@ func getAKMFromID(authID uint8) (auth string) {
493493
}
494494

495495
// Check if cipher and AKM they are associated for WPA-3
496-
func isWPA3Suite(cipher string, auth string) (bool) {
496+
func isWPA3Suite(cipher string, auth string) bool {
497497
// reference https://www.wi-fi.org/system/files/WPA3%20Specification%20v3.3.pdf
498498
switch cipher {
499499
case "GCMP", "GCMP256", "CCMP":
@@ -531,7 +531,7 @@ func GetENCSuite(packet gopacket.Packet) (encSuite string) {
531531
encSuite = "WPA2"
532532
if len(buf) > 7 {
533533
var rsnCipherCount uint16 = binary.LittleEndian.Uint16(buf[6:8])
534-
buf = buf[8:]
534+
buf = buf[8:]
535535
if len(buf) > int(rsnCipherCount)*4 {
536536
buf = buf[(rsnCipherCount-1)*4:]
537537
cipher = getCipherFromID(buf[3])
@@ -573,7 +573,9 @@ func GetENCSuite(packet gopacket.Packet) (encSuite string) {
573573
}
574574
}
575575
}
576-
if encSuite == "OPEN" {return "OPEN"}
576+
if encSuite == "OPEN" {
577+
return "OPEN"
578+
}
577579
if isWPA3Suite(cipher, auth) {
578580
encSuite = "WPA3"
579581
}
@@ -595,7 +597,7 @@ func GetENCSuite(packet gopacket.Packet) (encSuite string) {
595597
func GetESSID(packet gopacket.Packet) (ESSID string) {
596598
for _, layer := range packet.Layers() {
597599
if layer.LayerType() == layers.LayerTypeDot11InformationElement {
598-
if dot11info, exist := layer.(*layers.Dot11InformationElement); exist && dot11info.ID == layers.Dot11InformationElementIDSSID {
600+
if dot11info, exist := layer.(*layers.Dot11InformationElement); exist && dot11info.ID == layers.Dot11InformationElementIDSSID {
599601
if len(dot11info.Info) == 0 {
600602
return "<hidden>"
601603
} else if IsValidESSID(string(dot11info.Info)) {

libs/mon/monitorchoice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package mon
22

33
import (
44
"fmt"
5+
chipset "gapcast/libs/mon/chipset"
56
"os/exec"
67
"strings"
7-
chipset "gapcast/libs/mon/chipset"
88
)
99

1010
type mode int

0 commit comments

Comments
 (0)