fixer

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupStyleConflicts

func CleanupStyleConflicts(projectPath string, style string) error

CleanupStyleConflicts removes conflicting files based on the chosen style This prevents duplicate type declarations when switching between go_zero and gozero styles

func DetectExistingStyle

func DetectExistingStyle(projectPath string) string

DetectExistingStyle detects which naming style is currently used in the project Returns "go_zero" or "gozero", or empty string if cannot determine

func FixImports

func FixImports(projectPath string, moduleName string) error

FixImports fixes import paths in generated code Replaces absolute paths with local module names

func GetGoModuleName

func GetGoModuleName(projectPath string) (string, error)

GetGoModuleName extracts module name from go.mod file

func InitializeGoModule

func InitializeGoModule(projectPath string, moduleName string) error

InitializeGoModule initializes a Go module in the project directory

func SuggestStyleBasedOnExisting

func SuggestStyleBasedOnExisting(projectPath string, defaultStyle string) string

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

func TidyGoModule(projectPath string) error

TidyGoModule runs go mod tidy to resolve dependencies

func UpdateConfigFile

func UpdateConfigFile(projectPath string, serviceName string, port int) error

UpdateConfigFile updates configuration files with correct settings

func ValidateNoStyleConflicts

func ValidateNoStyleConflicts(projectPath string) error

ValidateNoStyleConflicts checks if there are any style conflicts in the project Returns an error if conflicts are found

func VerifyBuild

func VerifyBuild(projectPath string) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL