containers / virtcontainers

A Go package for building hardware virtualized container runtimes
Apache License 2.0
139 stars 43 forks source link

Remove redundant "if" checks #490

Closed WeiZhang555 closed 6 years ago

WeiZhang555 commented 6 years ago

Some "if" checks are redundant, we can remove them and return error directly instead.

Signed-off-by: Zhang Wei zhangwei555@huawei.com

WeiZhang555 commented 6 years ago

This is detected by a latest golint tools, I can see that you have enabled gometalinter tools in you CI, I guess the reason that gometalinter didn't detected this is that it's using a old golint tool.

As the issue is real, I think it's better to fix this, or we still need to fix this someday when we updated gometalinter. :smile:

sboeuf commented 6 years ago

LGTM

Approved with PullApprove Approved with PullApprove

sboeuf commented 6 years ago

@WeiZhang555 thanks for the PR, I agree it's good to clean those asap!

WeiZhang555 commented 6 years ago

@sboeuf 🤝 👍