You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- (Optional - only need if building from source) [AWS CloudFormation CLI Go Plugin](https://github.com/aws-cloudformation/cloudformation-cli-go-plugin/) > v1.0
95
-
- (Optional - only need if building from source) [Go](https://golang.org/doc/install) v1.23
95
+
- (Optional - only need if building from source) [Go](https://golang.org/doc/install) (version pinned in [`cfn-resources/go.mod`](cfn-resources/go.mod))
96
+
97
+
## Development Setup
98
+
99
+
The Go module lives in `cfn-resources/`, but `make` targets are run from the repository root and `cd` into `cfn-resources/` as needed.
100
+
101
+
- Run `make tools` once to install the dev tools (`golangci-lint`, `goimports`, `shfmt`, `actionlint`, `mockery`, etc.). Tools install into `$(go env GOPATH)/bin`; the Makefile prepends it to `PATH` for subsequent targets.
102
+
- Run `make link-git-hooks` to install the pre-commit hook. The hook calls `make verify files=$STAGED_GO_FILES` against staged Go files.
103
+
- Run `make fix` to apply formatting (`gofmt`, `goimports`), `golangci-lint --fix`, `go mod tidy`, and `go fix ./...`. This is the default `make` target.
104
+
- Run `make verify` to run the same checks read-only. CI runs this; missing `go fix` rewrites or formatter drift fail the build. Pass `files="path/one.go path/two.go"` to scope the checks.
105
+
- Run `make unit-test` to run the Go unit tests (excludes the e2e packages).
106
+
- Run `make generate-mocks` after changing a mocked interface (output lands in `cfn-resources/testutil/mocksvc`).
107
+
108
+
The `golangci-lint` version is pinned in the `Makefile` (`GOLANGCI_VERSION`) and is the single source of truth; the CI workflow picks it up via `make tools`.
96
109
97
110
## Testing the Provider
98
111
Please see README for each resource for details on unit and integrated AWS testing.
0 commit comments