xeals / signal-back

Decrypt Signal encrypted backups outside the app
Apache License 2.0
704 stars 67 forks source link

Fix linter non-style issues, add modules #42

Open nezorflame opened 5 years ago

nezorflame commented 5 years ago

This PR fixes few issues reported by golangci-lint linters golint, govet, gosec, unused and errcheck. Also adds preliminary support for Go modules.

nezorflame commented 5 years ago

I stand corrected - these warnings were produced by golangci-lint, which uses multiple linters internally, including golint. These warnings were given by it.

Most of the changes are fixes for the warning of the errcheck linter, which checks for the missing error checks in the code. The warning given was Error return value of ... is not checked (errcheck)

nezorflame commented 5 years ago

There are still some warnings left, but they are mostly non-essential. If you'd like, I can post you the full output here.

nezorflame commented 5 years ago

Ready to be reviewed again. Also I've added initial Go modules support since dependency management is pretty stable these days (we use it at my work in production without any issues). This will also allow people to use go get again for this binary starting with Go 1.12, because thanks to the modules, it'll use correct dependency versions.

m0 commented 5 years ago

Thanks for adding the modules @nezorflame! You might want to split the module patch and the style changes into two separate PRs for easier review. While I have no opinion about the style changes, I think the added modules are a great improvement.

nezorflame commented 5 years ago

@m0 @xeals as requested, I've separated style changes with the module PR (see #61).

So far it seems that all the essential golangci-lint issues have been addressed.