Documentation
¶
Index ¶
- func CleanupStyleConflicts(projectPath string, style string) error
- func DetectExistingStyle(projectPath string) string
- func FixImports(projectPath string, moduleName string) error
- func GetGoModuleName(projectPath string) (string, error)
- func InitializeGoModule(projectPath string, moduleName string) error
- func SuggestStyleBasedOnExisting(projectPath string, defaultStyle string) string
- func TidyGoModule(projectPath string) error
- func UpdateConfigFile(projectPath string, serviceName string, port int) error
- func ValidateNoStyleConflicts(projectPath string) error
- func VerifyBuild(projectPath string) error
- type StyleConflictPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupStyleConflicts ¶
CleanupStyleConflicts removes conflicting files based on the chosen style This prevents duplicate type declarations when switching between go_zero and gozero styles
func DetectExistingStyle ¶
DetectExistingStyle detects which naming style is currently used in the project Returns "go_zero" or "gozero", or empty string if cannot determine
func FixImports ¶
FixImports fixes import paths in generated code Replaces absolute paths with local module names
func GetGoModuleName ¶
GetGoModuleName extracts module name from go.mod file
func InitializeGoModule ¶
InitializeGoModule initializes a Go module in the project directory
func SuggestStyleBasedOnExisting ¶
SuggestStyleBasedOnExisting suggests which style to use based on existing files Returns the detected style, or the provided default if no existing style detected
func TidyGoModule ¶
TidyGoModule runs go mod tidy to resolve dependencies
func UpdateConfigFile ¶
UpdateConfigFile updates configuration files with correct settings
func ValidateNoStyleConflicts ¶
ValidateNoStyleConflicts checks if there are any style conflicts in the project Returns an error if conflicts are found
func VerifyBuild ¶
VerifyBuild verifies the project builds successfully
Types ¶
type StyleConflictPair ¶
type StyleConflictPair struct {
GoZeroStyle string // go_zero style: snake_case (e.g., service_context.go)
GoZeroFlat string // gozero style: flat (e.g., servicecontext.go)
}
StyleConflictPair represents a pair of files that conflict due to different naming styles