crossplane / crossplane/function-template-go
Repository initialization has hard assumptions
- Dominant language
- Go
- Stars
- 39
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
### What Happened?
I've cloned the repository and run `./init.sh my-cool-fn`. The `init.sh` script is currently only changing the package names but not updating the Go module path. Updating the Go module path is essential for the package to function properly and to facilitate hosting on GitHub/GitLab.
### Proposal
I expect the `init.sh` script to take the Go module path as its first argument. This will ensure that both the import paths and the Go module paths are updated correctly. To maintain compatibility with the `example/*` replacements, we can extract and use the last segment of the path as the package name.
1. Clone or download the repository.
2. Run `./init.sh github.com/my-fancy-org/my-cool-fn`.
3. Should update as following:
1. `go.mod` gets updated to `github.com/my-fancy-org/my-cool-fn`.
2. `fn.go` gets updated to `github.com/my-fancy-org/my-cool-fn/input/v1beta1`.
3. Replace `function-template-go` with `my-cool-fn`
### Steps to Reproduce
1. Clone or download the repository.
2. Run `./init.sh my-cool-fn`.
4. Verify the following:
1. `go.mod` gets updated to `github.com/crossplane/my-cool-fn`.
2. `fn.go` gets updated to `github.com/crossplane/my-cool-fn/input/v1beta1`.
### Environment Details
- Function version: main branch
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.