Skip to content

Remove nil == nil if-statement #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rwelin
Copy link

@rwelin rwelin commented Nov 20, 2019

Found using the nilness analysis:

$ go install golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness
$ go vet -vettool=$(which nilness)
\# github.com/json-iterator/go
./iter_object.go:241:10: tautological condition: nil == nil
Found using the nilness analysis:
```
$ go install golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness
$ go vet -vettool=$(which nilness)
\# github.com/json-iterator/go
./iter_object.go:241:10: tautological condition: nil == nil
```
@codecov
Copy link

codecov bot commented Nov 20, 2019

Codecov Report

Merging #420 into master will increase coverage by 0.05%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
+ Coverage   86.46%   86.52%   +0.05%     
==========================================
  Files          41       41              
  Lines        5105     5104       -1     
==========================================
+ Hits         4414     4416       +2     
+ Misses        555      552       -3     
  Partials      136      136
Impacted Files Coverage Δ
iter_object.go 68.25% <0%> (+0.35%) ⬆️
reflect_struct_decoder.go 81.62% <0%> (+0.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44a7e73...8d1a6f7. Read the comment docs.

@rwelin
Copy link
Author

rwelin commented Nov 20, 2019

Is it correct that readObjectFieldAsBytes is actually unused and could be completely removed instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant