Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

goctl new github.com/foo/bar, should create a folder named bar and a go module name github.com/foo/bar #3824

Open
errpunk opened this issue Dec 29, 2023 · 3 comments
Assignees
Labels
area/goctl Categorizes issue or PR as related to goctl.

Comments

@errpunk
Copy link

errpunk commented Dec 29, 2023

Is your feature request related to a problem? Please describe.
A typical Go module is named in the format of 'example.com/foo/bar.' However, whenever I run the goctl api new example.com/foo/bar command, it only creates a module named 'bar.' It generates the 'example.com' directory, then creates the 'foo' subdirectory within it, and finally, creates the 'bar' subdirectory under the 'foo' directory."

Describe the solution you'd like
create a go module name "example.com/foo/bar", and create only one root directory name bar

Describe alternatives you've considered
maybe add --module, --out-dir flag will do, too

Additional context
no

@kesonan
Copy link
Collaborator

kesonan commented Jan 3, 2024

Generating modules through the working directory is goctl's design, but we will discuss your suggestion internally and give you a specific reply.

@Twacqwq
Copy link

Twacqwq commented Jan 3, 2024

You can specify the path when creating a service, the essence is just this, but i usually switch to the specified directory to generate the module and then modify the go.mod file.
If it is possible to specify the module name on the goctl, maybe it will be more convenient.

goctl api new demo --module example/foo/bar

@kevwan kevwan added the area/goctl Categorizes issue or PR as related to goctl. label Jan 13, 2024
@Twacqwq
Copy link

Twacqwq commented Jan 30, 2024

I have some ideas about this implementation, so I tried to submit this PR. please check it when you're available. thx. have a nice day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/goctl Categorizes issue or PR as related to goctl.
Projects
None yet
Development

No branches or pull requests

4 participants