summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-03-27 20:08:07 +0200
committerxengineering <me@xengineering.eu>2023-03-27 20:08:07 +0200
commit5c2d27cd4adbf517a15b7b4644098fa42d69df19 (patch)
treec07c1487a4a4b0b6f8f3d7326265752f15aaada6
parentab28c680f57c73f80e602dd74f8b2eeaecc88f11 (diff)
downloadwebiot-5c2d27cd4adbf517a15b7b4644098fa42d69df19.tar
webiot-5c2d27cd4adbf517a15b7b4644098fa42d69df19.tar.zst
webiot-5c2d27cd4adbf517a15b7b4644098fa42d69df19.zip
Apply `go fmt` to all files
-rw-r--r--hs100.go8
-rw-r--r--main.go6
2 files changed, 5 insertions, 9 deletions
diff --git a/hs100.go b/hs100.go
index c972f8a..ff25576 100644
--- a/hs100.go
+++ b/hs100.go
@@ -1,5 +1,3 @@
-// vim: shiftwidth=4 tabstop=4 noexpandtab
-
package main
import (
@@ -21,7 +19,7 @@ type Hs100 struct {
// Hs100Conf is the configuration of one TP-Link HS100 smart plug.
type Hs100Conf struct {
- Ip net.IP
+ Ip net.IP
Name string
}
@@ -72,7 +70,7 @@ func send(address string, data []byte) error {
// create a Dialer with context
var d net.Dialer
- ctx, cancel := context.WithTimeout(context.Background(), 3 * time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()
// establish connection
@@ -113,6 +111,6 @@ func set(host string, state string) error {
return err
}
err = send(address, data)
-
+
return err
}
diff --git a/main.go b/main.go
index e853616..637f7d1 100644
--- a/main.go
+++ b/main.go
@@ -1,5 +1,3 @@
-// vim: shiftwidth=4 tabstop=4 noexpandtab
-
package main
import (
@@ -15,7 +13,7 @@ import (
"text/template"
)
-var appdata string;
+var appdata string
type RuntimeConfig struct {
Devices DevicesConfig
@@ -27,7 +25,7 @@ type DevicesConfig struct {
}
type WebConfig struct {
- Listen netip.AddrPort
+ Listen netip.AddrPort
}
// main() contains the control flow of this program.