Skip to content

Add golangci-lint, and fix linting issues - #876

Closed
umarcor wants to merge 21 commits into
spf13:masterfrom
umarcor:golangci-lint
Closed

umarcor wants to merge 21 commits into
spf13:masterfrom
umarcor:golangci-lint

Conversation

@umarcor

@umarcor umarcor commented Jun 7, 2019 •

Copy link
Copy Markdown
Contributor

Close #774
Close #853
Close #933

In this PR, golangci-lint is added to Travis CI. Then, multiple linting issues are fixed: errors are handled, unused variables/functions are removed, unnecessary types are removed, frequently used strings are defined as constants, etc.

As a result of using io.StringWriter and os.UserHomeDir, merging this PR implies dropping support for golang 1.10.x and 1.11.x.

@andig andig mentioned this pull request Aug 23, 2019
@umarcor
umarcor force-pushed the golangci-lint branch 2 times, most recently from 36f1bcb to 102ec4c Compare September 5, 2019 15:09
@umarcor
umarcor force-pushed the golangci-lint branch 2 times, most recently from 627305e to c9c0123 Compare September 17, 2019 16:28
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 2, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
@umarcor umarcor mentioned this pull request Oct 9, 2019
@umarcor
umarcor force-pushed the golangci-lint branch 3 times, most recently from 06836a5 to 48f9c90 Compare October 9, 2019 23:37
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 14, 2019
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
@umarcor

umarcor commented Jan 4, 2020 •

Copy link
Copy Markdown
Contributor Author

@jharshman, since go 1.10.x and 1.11.x are officially deprecated (see https://golang.org/doc/devel/release.html and https://endoflife.date/go), I believe we should consider this PR for inclusion in v1.0.0. This PR does not include any functional modification; it is all about using up-to-date linters and fixing outdated/broken/unused code.

@umarcor
umarcor force-pushed the golangci-lint branch 2 times, most recently from 9c0851f to 4ab14c0 Compare January 4, 2020 18:29
* circleci: export GO111MODULE=on, add 1.13.x, remove 1.11.x
* travis: add go 1.13.x
umarcor added a commit to umarcor/cobra that referenced this pull request Jan 6, 2020
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Jan 22, 2020
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Jan 22, 2020
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Feb 3, 2020
* deprecate go 1.10.x and 1.11.x
* use golangci-lint in Travis CI
* fix linting issues accordingly
@umarcor umarcor mentioned this pull request Feb 3, 2020
@jharshman

Copy link
Copy Markdown
Collaborator

closed by #976

@jharshman jharshman closed this Feb 20, 2020
@umarcor

umarcor commented Feb 20, 2020 •

Copy link
Copy Markdown
Contributor Author

@jharshman, this issue is about adding golangci-lint to have a more complete set of linters. Then, the source code is modified to fix all the issues/bugs that are currently ignored due to a lack of linting tools. Deprecating 1.10.x and 1.11.x is an effect of enhancing the code to use modern features; not the purpose of the issue.

Since #976 does not enhance nor fix linting, I'd like to have this issue reopened.

@umarcor umarcor changed the title Add golangci-lint, deprecate go 1.10.x and 1.11.x, cleanup/fixes Add golangci-lint, and fix linting issues Feb 20, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Feb 20, 2020
* use golangci-lint in Travis CI
* fix linting issues accordingly
@umarcor umarcor mentioned this pull request Feb 26, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Mar 1, 2020
* use golangci-lint in Travis CI
* fix linting issues accordingly
umarcor added a commit to umarcor/cobra that referenced this pull request Mar 1, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Apr 13, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request May 11, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request May 11, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request May 11, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Jul 4, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Jul 11, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Jul 13, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Aug 29, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Sep 25, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 1, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 14, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Oct 18, 2020
umarcor added a commit to umarcor/cobra that referenced this pull request Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated files are not goimports-ed

2 participants