Browse Source

Cleaning code to please the linter

Added feature for #145
Fix bug #145
feature/android
Philippe Caseiro 11 months ago
parent
commit
364dfecb31
4 changed files with 12 additions and 3 deletions
  1. 1
    1
      go.mod
  2. 1
    1
      openwrt/network.go
  3. 9
    0
      openwrt/uci_test.go
  4. 1
    1
      openwrt/wifi.go

+ 1
- 1
go.mod View File

@@ -3,7 +3,7 @@ module forge.cadoles.com/Pyxis/orion
3 3
 require (
4 4
 	forge.cadoles.com/Pyxis/golang-socketio v0.0.0-20180919100209-bb857ced6b95
5 5
 	github.com/caarlos0/env v3.3.0+incompatible
6
-	github.com/davecgh/go-spew v1.1.1 // indirect
6
+	github.com/davecgh/go-spew v1.1.1
7 7
 	github.com/go-chi/chi v3.3.3+incompatible
8 8
 	github.com/gorilla/websocket v1.4.0 // indirect
9 9
 	github.com/mitchellh/mapstructure v1.0.0

+ 1
- 1
openwrt/network.go View File

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

+ 9
- 0
openwrt/uci_test.go View File

@@ -22,6 +22,15 @@ func TestUCIAdd(t *testing.T) {
22 22
 	}
23 23
 }
24 24
 
25
+func TestUCIAddFailed(t *testing.T) {
26
+	exec := createMockExecutor("", "BigError", 3)
27
+	uci := NewUCIWithExecutor(exec)
28
+	res := uci.Add("wireless", "test")
29
+	if res.ReturnCode != 3 {
30
+		t.Error("Bad Return Code !")
31
+	}
32
+}
33
+
25 34
 func TestUCIDelete(t *testing.T) {
26 35
 	exec := createMockExecutor("", "", 0)
27 36
 	uci := NewUCIWithExecutor(exec)

+ 1
- 1
openwrt/wifi.go View File

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

Loading…
Cancel
Save