Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleu committed Sep 28, 2024
1 parent 52b1288 commit dfa267c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ linters-settings:
- condition
- operation
- return
gosec:
excludes:
- G115
govet:
settings:
printf:
Expand Down
6 changes: 3 additions & 3 deletions app/util/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ func StringPadLeft(s string, size int, chr rune) string {
return sb.String()
}

func StringTruncate(s string, max int) string {
if max > len(s) {
func StringTruncate(s string, mx int) string {
if mx > len(s) {
return s
}
return s[:strings.LastIndex(s[:max], " ")]
return s[:strings.LastIndex(s[:mx], " ")]
}

func StringRepeat(s string, n int) string {
Expand Down

0 comments on commit dfa267c

Please sign in to comment.