Skip to content

Commit

Permalink
Merge pull request #672 from alexandear/chore/enable-tenv-unconvert
Browse files Browse the repository at this point in the history
chore: enable unconvert and tenv linters
  • Loading branch information
danielgtaylor authored Dec 5, 2024
2 parents c4199b8 + c1ac658 commit 1a01022
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ linters:
- nolintlint
- perfsprint
- prealloc
- tenv
- testifylint
- unparam
- unconvert
- wastedassign
4 changes: 2 additions & 2 deletions huma.go
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ func Register[I, O any](api API, op Operation, handler func(context.Context, *I)
if err != nil {
return 0, err
}
return int64(val), nil
return val, nil
})
if err != nil {
res.Add(pb, value, "invalid integer")
Expand Down Expand Up @@ -1151,7 +1151,7 @@ func Register[I, O any](api API, op Operation, handler func(context.Context, *I)
if err != nil {
return 0, err
}
return uint64(val), nil
return val, nil
})
if err != nil {
res.Add(pb, value, "invalid integer")
Expand Down
11 changes: 3 additions & 8 deletions humacli/humacli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,9 @@ func TestCLIEnv(t *testing.T) {
Port int
}

os.Setenv("SERVICE_DEBUG", "true")
os.Setenv("SERVICE_HOST", "localhost")
os.Setenv("SERVICE_PORT", "8001")
defer func() {
os.Unsetenv("SERVICE_DEBUG")
os.Unsetenv("SERVICE_HOST")
os.Unsetenv("SERVICE_PORT")
}()
t.Setenv("SERVICE_DEBUG", "true")
t.Setenv("SERVICE_HOST", "localhost")
t.Setenv("SERVICE_PORT", "8001")

cli := humacli.New(func(hooks humacli.Hooks, options *Options) {
assert.True(t, options.Debug)
Expand Down

0 comments on commit 1a01022

Please sign in to comment.