Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kevwan
Copy link
Contributor

@kevwan kevwan commented Aug 31, 2025

No description provided.

@kevwan kevwan linked an issue Aug 31, 2025 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Aug 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for specifying custom Go module names when generating services with goctl. The feature is controlled by a new --module flag that allows users to set a custom module name instead of defaulting to the directory name.

  • Introduces PrepareWithModule and GetParentPackageWithModule functions to handle custom module names
  • Adds --module flag support to both API and RPC generation commands
  • Updates generators to use custom module names when creating go.mod files

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/goctl/util/ctx/context.go Adds PrepareWithModule function to support custom module initialization
tools/goctl/util/ctx/context_test.go Comprehensive tests for module functionality including edge cases
tools/goctl/pkg/golang/path.go Adds GetParentPackageWithModule with custom module support
tools/goctl/pkg/golang/path_test.go Tests for module-aware package path resolution
tools/goctl/rpc/generator/gen.go Integrates module support into RPC generation
tools/goctl/rpc/generator/gen_module_test.go Tests RPC generation with custom modules
tools/goctl/rpc/cli/*.go Adds --module flag to RPC command interface
tools/goctl/api/gogen/gen.go Adds DoGenProjectWithModule for API generation with custom modules
tools/goctl/api/new/*.go Integrates module support into API service creation
tools/goctl/internal/flags/default_en.json Adds help text for new --module flag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kevwan kevwan merged commit 955b801 into zeromicro:master Aug 31, 2025
6 checks passed
@kevwan kevwan deleted the fix/issue-5126 branch August 31, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nomination of golang module name when creating new project via CLI

1 participant