* ci: add `golangci-lint` + fix lints * switched order
@@ -29,6 +29,10 @@ jobs:
cache: true
- run: go mod download
- run: go build -v .
+ - name: Run linters
+ uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0
+ with:
+ version: latest
generate:
runs-on: ubuntu-latest
@@ -0,0 +1,27 @@
+# Visit https://golangci-lint.run/ for usage documentation
+# and information on other useful linters
+issues:
+ max-per-linter: 0
+ max-same-issues: 0
+
+linters:
+ disable-all: true
+ enable:
+ - durationcheck
+ - errcheck
+ - exportloopref
+ - forcetypeassert
+ - godot
+ - gofmt
+ - gosimple
+ - ineffassign
+ - makezero
+ - misspell
+ - nilerr
+ - predeclared
+ - staticcheck
+ - tenv
+ - unconvert
+ - unparam
+ - unused
+ - vet
@@ -11,7 +11,7 @@ import (
"github.com/hashicorp/terraform-plugin-log/tflog"
)
-// Ensure provider defined types fully satisfy framework interfaces
+// Ensure provider defined types fully satisfy framework interfaces.
var _ datasource.DataSource = &ExampleDataSource{}
func NewExampleDataSource() datasource.DataSource {
@@ -14,7 +14,7 @@ import (
var _ resource.Resource = &ExampleResource{}
var _ resource.ResourceWithImportState = &ExampleResource{}
@@ -21,11 +21,11 @@ import (
var (
// these will be set by the goreleaser configuration
- // to appropriate values for the compiled binary
+ // to appropriate values for the compiled binary.
version string = "dev"
- // goreleaser can also pass the specific commit if you want
- // commit string = ""
+ // goreleaser can pass other information to the main package, such as the specific commit
+ // https://goreleaser.com/cookbooks/using-main.version/
func main() {