Skip to content

Commit

Permalink
Enable linters for golangci-lint
Browse files Browse the repository at this point in the history
Enabled linters: prealloc, scopelint, typecheck, unconvert

Only "unconvert" linter had an issue in pkg/scaffold/project/project_test.go
whish is fixed.
  • Loading branch information
hypnoglow committed Jan 27, 2020
1 parent cf950d8 commit 41765a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/scaffold/project/project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Copyright %s Example Owners.
})

It("should skip writing Gopkg.toml", func() {
e := strings.Replace(string(result.Golden), project.DefaultGopkgHeader, "", -1)
e := strings.Replace(result.Golden, project.DefaultGopkgHeader, "", -1)
_, err = f.Write([]byte(e))
Expect(err).NotTo(HaveOccurred())
Expect(f.Close()).NotTo(HaveOccurred())
Expand All @@ -158,7 +158,7 @@ Copyright %s Example Owners.
})

It("should keep the user content", func() {
e := strings.Replace(string(result.Golden),
e := strings.Replace(result.Golden,
project.DefaultGopkgUserContent, "Hello World", -1)
_, err = f.Write([]byte(e))
Expect(err).NotTo(HaveOccurred())
Expand Down
4 changes: 4 additions & 0 deletions scripts/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ golangci-lint run --disable-all --deadline 5m \
--enable=maligned \
--enable=misspell \
--enable=nakedret \
--enable=prealloc \
--enable=scopelint \
--enable=staticcheck \
--enable=structcheck \
--enable=typecheck \
--enable=unconvert \
--enable=unparam \
--enable=unused \
--enable=varcheck \

0 comments on commit 41765a3

Please sign in to comment.