Revert "Minor refactors using golint"

This commit is contained in:
Simone Margaritelli 2018-05-03 12:31:42 +02:00 committed by GitHub
commit 5328ced392
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 101 additions and 70 deletions

View file

@ -83,30 +83,30 @@ func (w *WiFiModule) getRow(station *network.Station) ([]string, bool) {
recvd,
seen,
}, include
}
// this is ugly, but necessary in order to have this
// method handle both access point and clients
// transparently
clients := ""
if ap, found := w.Session.WiFi.Get(station.HwAddress); found {
if ap.NumClients() > 0 {
clients = strconv.Itoa(ap.NumClients())
} else {
// this is ugly, but necessary in order to have this
// method handle both access point and clients
// transparently
clients := ""
if ap, found := w.Session.WiFi.Get(station.HwAddress); found {
if ap.NumClients() > 0 {
clients = strconv.Itoa(ap.NumClients())
}
}
}
return []string{
fmt.Sprintf("%d dBm", station.RSSI),
bssid,
ssid,
/* station.Vendor, */
encryption,
strconv.Itoa(network.Dot11Freq2Chan(station.Frequency)),
clients,
sent,
recvd,
seen,
}, include
return []string{
fmt.Sprintf("%d dBm", station.RSSI),
bssid,
ssid,
/* station.Vendor, */
encryption,
strconv.Itoa(network.Dot11Freq2Chan(station.Frequency)),
clients,
sent,
recvd,
seen,
}, include
}
}
func (w *WiFiModule) Show(by string) error {