Make linters happy
This commit is contained in:
parent
4982e1b8b8
commit
bc1c3e6337
|
@ -34,9 +34,10 @@ func NewConnectionType(s string) ConnectionType {
|
||||||
return ConnectionUnknown
|
return ConnectionUnknown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConnectionType constants
|
||||||
const (
|
const (
|
||||||
ConnectionCellular = iota // default value, LTE, 4G, 3G, EDGE, etc.
|
ConnectionCellular ConnectionType = iota // default value, LTE, 4G, 3G, EDGE, etc.
|
||||||
ConnectionWifi // WIFI or iOS simulator
|
ConnectionWifi // WIFI or iOS simulator
|
||||||
ConnectionUnknown
|
ConnectionUnknown
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -5,15 +5,15 @@ import "testing"
|
||||||
func TestConnectionType(t *testing.T) {
|
func TestConnectionType(t *testing.T) {
|
||||||
c := NewConnectionType("wifi")
|
c := NewConnectionType("wifi")
|
||||||
if c != ConnectionWifi {
|
if c != ConnectionWifi {
|
||||||
t.Fatalf("Wrong connection type: %s", c)
|
t.Fatalf("Wrong connection type: %v", c)
|
||||||
}
|
}
|
||||||
c = NewConnectionType("cellular")
|
c = NewConnectionType("cellular")
|
||||||
if c != ConnectionCellular {
|
if c != ConnectionCellular {
|
||||||
t.Fatalf("Wrong connection type: %s", c)
|
t.Fatalf("Wrong connection type: %v", c)
|
||||||
}
|
}
|
||||||
c = NewConnectionType("bluetooth")
|
c = NewConnectionType("bluetooth")
|
||||||
if c != ConnectionUnknown {
|
if c != ConnectionUnknown {
|
||||||
t.Fatalf("Wrong connection type: %s", c)
|
t.Fatalf("Wrong connection type: %v", c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue