Make linters happy

This commit is contained in:
Ivan Danyliuk 2018-02-09 22:55:05 +02:00 committed by Frank Mueller
parent 4982e1b8b8
commit bc1c3e6337
2 changed files with 6 additions and 5 deletions

View File

@ -34,9 +34,10 @@ func NewConnectionType(s string) ConnectionType {
return ConnectionUnknown
}
// ConnectionType constants
const (
ConnectionCellular = iota // default value, LTE, 4G, 3G, EDGE, etc.
ConnectionWifi // WIFI or iOS simulator
ConnectionCellular ConnectionType = iota // default value, LTE, 4G, 3G, EDGE, etc.
ConnectionWifi // WIFI or iOS simulator
ConnectionUnknown
)

View File

@ -5,15 +5,15 @@ import "testing"
func TestConnectionType(t *testing.T) {
c := NewConnectionType("wifi")
if c != ConnectionWifi {
t.Fatalf("Wrong connection type: %s", c)
t.Fatalf("Wrong connection type: %v", c)
}
c = NewConnectionType("cellular")
if c != ConnectionCellular {
t.Fatalf("Wrong connection type: %s", c)
t.Fatalf("Wrong connection type: %v", c)
}
c = NewConnectionType("bluetooth")
if c != ConnectionUnknown {
t.Fatalf("Wrong connection type: %s", c)
t.Fatalf("Wrong connection type: %v", c)
}
}