Skip to content

Commit

Permalink
chore: fix linter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
bxcodec authored Sep 20, 2023
1 parent 4b7b55d commit 189defb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
10 changes: 6 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ linters-settings:
golint:
min-confidence: 0.8
gocyclo:
min-complexity: 60
min-complexity: 70
maligned:
suggest-new: true
dupl:
Expand All @@ -27,7 +27,7 @@ linters:
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- deadcode
# - deadcode
- errcheck
- goconst
- gocyclo
Expand All @@ -37,12 +37,12 @@ linters:
- ineffassign
- misspell
- staticcheck
- structcheck
# - structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
# - varcheck

issues:
exclude-rules:
Expand All @@ -52,6 +52,8 @@ issues:
- path: datetime.go
linters:
- misspell
- path: .
text: "parameter 'v' seems to be unused"
run:
timeout: 5m
go: "1.17"
Expand Down
6 changes: 3 additions & 3 deletions faker.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,9 @@ func getFakedValue(item interface{}, opts *options.Options) (reflect.Value, erro

}
case tags.fieldType == SKIP:
item := originalDataVal.Field(i).Interface()
if v.CanSet() && item != nil {
v.Field(i).Set(reflect.ValueOf(item))
data := originalDataVal.Field(i).Interface()
if v.CanSet() && data != nil {
v.Field(i).Set(reflect.ValueOf(data))
}
default:
err := setDataWithTag(v.Field(i).Addr(), tags.fieldType, *opts)
Expand Down
2 changes: 1 addition & 1 deletion faker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2477,7 +2477,7 @@ func TestFakeData_RecursiveType(t *testing.T) {
}
}

func TestFakeDate_ConcurrentSafe(t *testing.T) {
func TestFakeDate_ConcurrentSafe(_ *testing.T) {
var wg sync.WaitGroup
wg.Add(1000)
fmt.Println("Running for loop…")
Expand Down
2 changes: 1 addition & 1 deletion misc/makefile/tools.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bin/tparse: bin
GOLANGCI := $(shell command -v golangci-lint || echo "bin/golangci-lint")
golangci-lint: bin/golangci-lint ## Installs golangci-lint (linter)

bin/golangci-lint: VERSION := 1.48.0
bin/golangci-lint: VERSION := 1.49.0
bin/golangci-lint: GITHUB := golangci/golangci-lint
bin/golangci-lint: ARCHIVE := golangci-lint-$(VERSION)-$(OSTYPE)-amd64.tar.gz
bin/golangci-lint: bin
Expand Down
2 changes: 1 addition & 1 deletion pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (
randomStringLen int32 = 25
lang unsafe.Pointer
randomMaxSize int32 = 100
randomMinSize int32 = 0
randomMinSize int32
iBoundary unsafe.Pointer
)

Expand Down
2 changes: 1 addition & 1 deletion random_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"
)

func TestSetRandomSource(t *testing.T) {
func TestSetRandomSource(_ *testing.T) {
SetRandomSource(NewSafeSource(mathrand.NewSource(time.Now().UnixNano())))

_ = rand.Int31n(100)
Expand Down

0 comments on commit 189defb

Please sign in to comment.