started structuring project for testing + lint driven various refactoring

This commit is contained in:
evilsocket 2018-04-24 15:12:25 +02:00
commit bc3be7dd2b
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
5 changed files with 17 additions and 18 deletions

View file

@ -241,8 +241,11 @@ func (d *BLERecon) onPeriphDisconnected(p gatt.Peripheral, err error) {
}
func (d *BLERecon) onPeriphConnected(p gatt.Peripheral, err error) {
// timed out
if d.currDevice == nil {
if err != nil {
log.Warning("Connected to %s but with error: %s", p.ID(), err)
return
} else if d.currDevice == nil {
// timed out
log.Warning("Connected to %s but after the timeout :(", p.ID())
return
}

View file

@ -162,7 +162,6 @@ func (s *EventsStream) Start() error {
} else {
log.Debug("Skipping ignored event %v", e)
}
break
case <-s.quit:
return

View file

@ -81,9 +81,9 @@ func (mc *MacChanger) Configure() (err error) {
}
func (mc *MacChanger) setMac(mac net.HardwareAddr) error {
os := runtime.GOOS
args := []string{}
var args []string
os := runtime.GOOS
if strings.Contains(os, "bsd") || os == "darwin" {
args = []string{mc.iface, "ether", mac.String()}
} else if os == "linux" || os == "android" {