Skip to content

Commit

Permalink
Fixes linting issues and bump linter version to 1.62.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryan51203 committed Dec 24, 2024
1 parent e7316de commit ead65ab
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ install-golangci-lint:
@echo "=====> Installing golangci-lint..."
@curl -sSfL \
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b $(GOPATH_BIN) v1.52.2
sh -s -- -b $(GOPATH_BIN) v1.62.2

lint: install-golangci-lint
@$(GO) vet $(GO_PACKAGES)
Expand Down
30 changes: 15 additions & 15 deletions golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
linters:
disable-all: true
enable:
- govet
- staticcheck
- unused
- gosimple
- revive
- unconvert
- goconst
- gocyclo
- gofmt
- goimports
- misspell
- lll
- govet
- staticcheck
- unused
- gosimple
- revive
- unconvert
- goconst
- gocyclo
- gofmt
- goimports
- misspell
- lll

linters-settings:
govet:
check-shadowing: true
shadow: true

errcheck:
check-type-assertions: true
Expand All @@ -41,8 +41,8 @@ linters-settings:

gocyclo:
min-complexity: 20

revive:
ignore-generated-header: true
ignore-patterns:
- "_"
- "_"
4 changes: 2 additions & 2 deletions helper/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

func RandomString(n int) string {
rand.Seed(time.Now().UnixNano())
r := rand.New(rand.NewSource(time.Now().UnixNano()))
sb := strings.Builder{}
sb.Grow(n)
for i := 0; i < n; i++ {
sb.WriteByte(charset[rand.Intn(len(charset))])
sb.WriteByte(charset[r.Intn(len(charset))])
}
return sb.String()
}

0 comments on commit ead65ab

Please sign in to comment.