Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
markusressel committed Sep 25, 2024
1 parent 8c6ae73 commit 7b06d4d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/curve/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var curveCmd = &cobra.Command{

err = configuration.Validate(configPath)
if err != nil {
ui.FatalWithoutStacktrace("configuration validation failed: %w", err)
ui.FatalWithoutStacktrace("configuration validation failed: %v", err)
}

curveConfigsToPrint := []configuration.CurveConfig{}
Expand Down
2 changes: 1 addition & 1 deletion cmd/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ var detectCmd = &cobra.Command{
}
tableString := buf.String()
if idx < (len(tables) - 1) {
ui.Printf(tableString)
ui.Print(tableString)
} else {
ui.Println(tableString)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/fan/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ var curveCmd = &cobra.Command{
panic(tableErr)
}
tableString := buf.String()
ui.Printfln(tableString)
ui.Println(tableString)

// print graph
if fanCurveErr != nil {
ui.Printfln("No fan curve data yet...")
ui.Println("No fan curve data yet...")
continue
}

Expand All @@ -99,7 +99,7 @@ var curveCmd = &cobra.Command{

caption := "RPM / PWM"
graph := asciigraph.Plot(values, asciigraph.Height(15), asciigraph.Width(100), asciigraph.Caption(caption))
ui.Printfln(graph)
ui.Println(graph)
}
},
}
Expand Down
8 changes: 6 additions & 2 deletions internal/ui/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ func SetDebugEnabled(enabled bool) {
pterm.PrintDebugMessages = enabled
}

func Println(format string) {
pterm.Println(format)
func Print(format string) {
pterm.Print(format)
}

func Printf(format string, a ...interface{}) {
pterm.Printf(format, a...)
}

func Println(format string) {
pterm.Println(format)
}

func Printfln(format string, a ...interface{}) {
pterm.Printfln(format, a...)
}
Expand Down

0 comments on commit 7b06d4d

Please sign in to comment.