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.
- Clone or download the repository.
- Run
./init.sh github.com/my-fancy-org/my-cool-fn.
- Should update as following:
go.mod gets updated to github.com/my-fancy-org/my-cool-fn.
fn.go gets updated to github.com/my-fancy-org/my-cool-fn/input/v1beta1.
- Replace
function-template-go with my-cool-fn
Steps to Reproduce
- Clone or download the repository.
- Run
./init.sh my-cool-fn.
- Verify the following:
go.mod gets updated to github.com/crossplane/my-cool-fn.
fn.go gets updated to github.com/crossplane/my-cool-fn/input/v1beta1.
Environment Details
- Function version: main branch
What Happened?
I've cloned the repository and run
./init.sh my-cool-fn. Theinit.shscript 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.shscript 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 theexample/*replacements, we can extract and use the last segment of the path as the package name../init.sh github.com/my-fancy-org/my-cool-fn.go.modgets updated togithub.com/my-fancy-org/my-cool-fn.fn.gogets updated togithub.com/my-fancy-org/my-cool-fn/input/v1beta1.function-template-gowithmy-cool-fnSteps to Reproduce
./init.sh my-cool-fn.go.modgets updated togithub.com/crossplane/my-cool-fn.fn.gogets updated togithub.com/crossplane/my-cool-fn/input/v1beta1.Environment Details