utils

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RED    = "\033[0;31m"
	GREEN  = "\033[0;32m"
	YELLOW = "\033[1;33m"
	BLUE   = "\033[0;34m"
	NC     = "\033[0m" // No Color
)

颜色定义

Variables

This section is empty.

Functions

func CleanModuleName

func CleanModuleName(name string) string

CleanModuleName 清理模块名,移除或替换特殊字符

func ExitWith

func ExitWith(msg string)

ExitWith 退出程序

func FindRepoRoot

func FindRepoRoot(start string) string

FindRepoRoot 查找仓库根目录

func GetPackagePath

func GetPackagePath(repoRoot string) (string, error)

GetPackagePath 从go.mod文件获取项目包路径

func MustWrite

func MustWrite(path, content string, force bool)

MustWrite 写入文件

func Pluralize

func Pluralize(s string) string

Pluralize 复数化

func PrintError

func PrintError(format string, args ...interface{})

PrintError 打印错误信息

func PrintInfo

func PrintInfo(format string, args ...interface{})

PrintInfo 打印信息

func PrintSuccess

func PrintSuccess(format string, args ...interface{})

PrintSuccess 打印成功信息

func PrintUsageInstructions

func PrintUsageInstructions(name, pascal string)

PrintUsageInstructions 打印使用说明

func PrintWarning

func PrintWarning(format string, args ...interface{})

PrintWarning 打印警告信息

func ToCamel

func ToCamel(s string) string

ToCamel 转换为Camel命名

func ToPascal

func ToPascal(s string) string

ToPascal 转换为Pascal命名

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase 转换为蛇形命名

func TryInject

func TryInject(filePath, item string) error

TryInject 尝试注入到fx.Options

Types

This section is empty.

Jump to

Keyboard shortcuts

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