Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
naggie committed Dec 16, 2024
1 parent f7cff22 commit f589a2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions cmd/dstask/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ func main() {
completions.Completions(conf, os.Args, ctx)

case dstask.CMD_PRINT_BASH_COMPLETION:
fmt.Printf(completions.Bash)
fmt.Print(completions.Bash)

case dstask.CMD_PRINT_ZSH_COMPLETION:
fmt.Printf(completions.Zsh)
fmt.Print(completions.Zsh)

case dstask.CMD_PRINT_FISH_COMPLETION:
fmt.Printf(completions.Fish)
fmt.Print(completions.Fish)
default:
panic("this should never happen?")
}
Expand Down
2 changes: 1 addition & 1 deletion table.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func FixStr(text string, width int) string {
text = strings.Split(text, "\n")[0]
length := width - runewidth.StringWidth(text)
if length >= 0 {
return fmt.Sprintf("%s", text) + strings.Repeat(" ", length)
return text + strings.Repeat(" ", length)
}
return runewidth.Truncate(text, width, " ")
}
Expand Down
3 changes: 1 addition & 2 deletions util_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dstask

import (
"io/ioutil"
"os"
"testing"

Expand Down Expand Up @@ -47,7 +46,7 @@ func TestMakeTempFilename(t *testing.T) {

assert.Equal(t, tc.expected, tf)

f, err := ioutil.TempFile("", tf)
f, err := os.CreateTemp("", tf)
assert.Nil(t, err)
assert.Nil(t, f.Close())
assert.Nil(t, os.Remove(f.Name()))
Expand Down

0 comments on commit f589a2c

Please sign in to comment.