Skip to content

Commit a689702

Browse files
committed
initial commit
0 parents  commit a689702

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/taigrr/temper-cli
2+
3+
go 1.20
4+
5+
require github.com/taigrr/temper v1.1.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/taigrr/temper v1.1.0 h1:tSKBrpDcfNffZPu7wOzQjJQVVUQkbf5+D5lwizwSk3s=
2+
github.com/taigrr/temper v1.1.0/go.mod h1:C5OtMbTQ1dtvWsjKALYF4L0lC+XltSC8kpHdRa5z9Yc=

main.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"log"
6+
7+
"github.com/taigrr/temper"
8+
)
9+
10+
var tempers []*temper.Temper
11+
12+
func main() {
13+
tempers, err := temper.FindTempers()
14+
if err != nil {
15+
panic(err)
16+
}
17+
if len(tempers) == 0 {
18+
log.Fatal("no tempers found\n")
19+
}
20+
for _, t := range tempers {
21+
defer t.Close()
22+
}
23+
for _, t := range tempers {
24+
c, err := t.ReadC()
25+
if err != nil {
26+
panic(err)
27+
}
28+
fmt.Printf("%.2f\n", c)
29+
}
30+
}

0 commit comments

Comments
 (0)