Cleaning code to please the linter

Added feature for #145
Fix bug #145
This commit is contained in:
2018-09-21 16:57:02 +02:00
parent f769ca382e
commit 364dfecb31
4 changed files with 12 additions and 3 deletions

View File

@ -24,7 +24,7 @@ func NewNetworkWithExecutor(exe Executor) *Network {
return &Network{exec}
}
// ListInterfaces list all available interfaces on a system using "ip" commmand
// ListInterfaces list all available interfaces on a system using "ip" command
func (n *Network) ListInterfaces() []net.Interface {
var result []net.Interface
ifaces, err := net.Interfaces()

View File

@ -22,6 +22,15 @@ func TestUCIAdd(t *testing.T) {
}
}
func TestUCIAddFailed(t *testing.T) {
exec := createMockExecutor("", "BigError", 3)
uci := NewUCIWithExecutor(exec)
res := uci.Add("wireless", "test")
if res.ReturnCode != 3 {
t.Error("Bad Return Code !")
}
}
func TestUCIDelete(t *testing.T) {
exec := createMockExecutor("", "", 0)
uci := NewUCIWithExecutor(exec)

View File

@ -61,7 +61,7 @@ func (w *Wifi) parseWifiCells(stdout string) int {
return 0
}
// GetWifiCells retrieves all availabe wifi cells for a card !
// GetWifiCells retrieves all available wifi cells for a card !
func (w *Wifi) GetWifiCells() int {
res := w.exec.Run("iwinfo", w.iface, "scan")
if res.ReturnCode != 0 {