-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lint job to Github actions and fixed lint errors (#36)
* Add lint job golangci/[email protected] and fixed lint errors. Fixed next lint errors: internal/login/login.go:122:19: Error return value of server.Shutdown is not checked (errcheck) main.go:30:23: Error return value of viper.SafeWriteConfig is not checked (errcheck) main.go:31:20: Error return value of viper.ReadInConfig is not checked (errcheck) main.go:63:14: Error return value of root.Execute is not checked (errcheck) internal/play/play.go:52:3: ineffectual assignment to err (ineffassign) internal/common.go:51:10: SA1015: using time.Tick leaks the underlying ticker, consider using it only in endless functions, tests and the main package, and use time.NewTicker here (staticcheck) * Update .github/workflows/test.yml - removed name for golangci/golangci-lint-action Co-authored-by: Brian Strauch <[email protected]> * Update internal/login/login.go -make staticcheck happy without err check Co-authored-by: Brian Strauch <[email protected]> * Update main.go - replaced err !=nill check with cobra.CheckErr() Co-authored-by: Brian Strauch <[email protected]> * Update main.go - removed err check for viper.ReadInConfig() because of bad UX Co-authored-by: Brian Strauch <[email protected]> * Updated main.go - unused imports and undefined: err * Updated play/play.go - add another check in the else block and delete the check below the entire if/else because otherwise, staticcheck reports an error * Updated go.mod and go.sum - removed unused dependencies Co-authored-by: Brian Strauch <[email protected]>
- Loading branch information
1 parent
8d5d257
commit 7dccf57
Showing
5 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,13 @@ jobs: | |
- name: Test | ||
run: go test -v ./... | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- uses: golangci/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters