Add test for batteries module, update deps

This commit is contained in:
eleksir
2024-09-23 00:20:06 +03:00
parent 4bff21f4c7
commit 7ce2d9d9ec
98 changed files with 3114 additions and 99 deletions

23
cmd/battery-test/main.go Normal file
View File

@@ -0,0 +1,23 @@
package main
import (
"fmt"
"time"
"github.com/davecgh/go-spew/spew"
"github.com/distatus/battery"
)
// Program entry point.
func main() {
for {
batteries, err := battery.GetAll()
if err != nil {
fmt.Printf("Unable to get battery info: %w", err)
}
spew.Dump(batteries)
time.Sleep(1 * time.Second)
}
}