aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2023-03-10 00:16:10 +0900
committernsfisis <nsfisis@gmail.com>2023-03-10 00:16:10 +0900
commit67c1fcf7467e59edea1d50358dc35bb5dcde3224 (patch)
tree22c9a70a27ec06f016fb1b539ea3182bb2c625ff
parent6a90aaa2ec54518c68fed97380fa316ce25fb6a1 (diff)
downloadterm-clock-67c1fcf7467e59edea1d50358dc35bb5dcde3224.tar.gz
term-clock-67c1fcf7467e59edea1d50358dc35bb5dcde3224.tar.zst
term-clock-67c1fcf7467e59edea1d50358dc35bb5dcde3224.zip
chore: go fmt
-rw-r--r--cmd/clock.go6
-rw-r--r--cmd/timer.go14
-rw-r--r--internal/term/draw.go2
-rw-r--r--internal/term/screen.go10
4 files changed, 16 insertions, 16 deletions
diff --git a/cmd/clock.go b/cmd/clock.go
index 3e12590..71244c4 100644
--- a/cmd/clock.go
+++ b/cmd/clock.go
@@ -81,8 +81,8 @@ func cmdClock(cmd *cobra.Command, args []string) {
}
}
-var clockCmd =&cobra.Command{
- Use: "clock",
+var clockCmd = &cobra.Command{
+ Use: "clock",
Short: "Clock mode",
- Run: cmdClock,
+ Run: cmdClock,
}
diff --git a/cmd/timer.go b/cmd/timer.go
index ff11451..b4f9857 100644
--- a/cmd/timer.go
+++ b/cmd/timer.go
@@ -10,8 +10,8 @@ import (
)
func drawTimer(scr *term.Screen, leftTime time.Duration, bgStyle, fgStyle term.Style) {
- if leftTime<=0{
- leftTime=0
+ if leftTime <= 0 {
+ leftTime = 0
bgStyle, fgStyle = fgStyle, bgStyle
}
@@ -56,7 +56,7 @@ func drawTimer(scr *term.Screen, leftTime time.Duration, bgStyle, fgStyle term.S
func cmdTimer(cmd *cobra.Command, args []string) {
timerTime, err := time.ParseDuration(args[0])
if err != nil {
- log.Fatalf("%+v", err)
+ log.Fatalf("%+v", err)
}
scr, err := term.NewScreen()
@@ -89,9 +89,9 @@ func cmdTimer(cmd *cobra.Command, args []string) {
}
}
-var timerCmd =&cobra.Command{
- Use: "timer",
+var timerCmd = &cobra.Command{
+ Use: "timer",
Short: "Timer mode",
- Run: cmdTimer,
- Args: cobra.ExactArgs(1),
+ Run: cmdTimer,
+ Args: cobra.ExactArgs(1),
}
diff --git a/internal/term/draw.go b/internal/term/draw.go
index c6f297f..9ce640a 100644
--- a/internal/term/draw.go
+++ b/internal/term/draw.go
@@ -4,7 +4,7 @@ import (
"github.com/gdamore/tcell/v2"
)
-type Style tcell.Style;
+type Style tcell.Style
var (
BgStyle Style
diff --git a/internal/term/screen.go b/internal/term/screen.go
index 14bfcfb..fc1555f 100644
--- a/internal/term/screen.go
+++ b/internal/term/screen.go
@@ -5,22 +5,22 @@ import (
)
type Screen struct {
- scr tcell.Screen
+ scr tcell.Screen
onResize func() bool
- QuitC chan struct{}
+ QuitC chan struct{}
}
func NewScreen() (*Screen, error) {
scr, err := tcell.NewScreen()
- if err != nil{
+ if err != nil {
return nil, err
}
err = scr.Init()
- if err != nil{
+ if err != nil {
return nil, err
}
return &Screen{
- scr: scr,
+ scr: scr,
QuitC: make(chan struct{}),
}, nil
}