Documentation
¶
Index ¶
- func AddImport(file, alias, impt string) ([]byte, error)
- func AddImportForContent(fileContent []byte, alias, impt string) ([]byte, error)
- func AddSlashForComments(s string) string
- func BaseName(include, subFixToTrim string) string
- func BaseNameAndTrim(include string) string
- func Bytes2Str(in []byte) (out string)
- func CamelString(s string) string
- func CopyString2StringMap(from, to map[string]string)
- func CopyStringSlice(from, to *[]string)
- func GetBuildGoPaths() []string
- func GetFirstKV(m map[string][]string) (string, []string)
- func GetGOPATH() (gopath string, err error)
- func GetHandlerPackageUniqueName(name string) (string, error)
- func GetMiddlewareUniqueName(name string) (string, error)
- func GetPackageUniqueName(name string) (string, error)
- func ImportToPath(path, subFix string) string
- func ImportToPathAndConcat(path, subFix string) string
- func InitGoMod(module string) error
- func IsWindows() bool
- func MapForm(input []string) (map[string][]string, error)
- func PackArgs(c interface{}) (res []string, err error)
- func PathExist(path string) (bool, error)
- func PathToImport(path, subFix string) string
- func RelativePath(path string) (string, error)
- func SearchGoMod(cwd string, recurse bool) (moduleName, path string, found bool)
- func SnakeString(s string) string
- func SplitGoTags(input string) []string
- func SplitPackage(pkg, subFixToTrim string) string
- func SplitPackageName(pkg, subFixToTrim string) string
- func Str2Bytes(in string) (out []byte)
- func SubDir(root, subPkg string) string
- func SubPackage(mod, dir string) string
- func SubPackageDir(path string) string
- func ToCamelCase(name string) string
- func ToGoFuncName(s string) string
- func ToHttpMethod(name string) string
- func ToLowerCamelCase(name string) string
- func ToSnakeCase(name string) string
- func ToVarName(paths []string) string
- func TrimLastChar(s string) string
- func TrimSuffix(s string) string
- func UnpackArgs(args []string, c interface{}) error
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddImportForContent ¶
func AddSlashForComments ¶
AddSlashForComments can adjust the format of multi-line comments
func BaseNameAndTrim ¶
func CamelString ¶
CamelString converts the string 's' to a camel string
func CopyString2StringMap ¶
func CopyStringSlice ¶
func CopyStringSlice(from, to *[]string)
func GetBuildGoPaths ¶
func GetBuildGoPaths() []string
GetBuildGoPaths returns the list of Go path directories.
func GetMiddlewareUniqueName ¶
GetMiddlewareUniqueName can get a non-repeating variable name for middleware name
func GetPackageUniqueName ¶
GetPackageUniqueName can get a non-repeating variable name for package alias
func ImportToPath ¶
func ImportToPathAndConcat ¶
func PathToImport ¶
func RelativePath ¶
func SearchGoMod ¶
SearchGoMod searches go.mod from the given directory (which must be an absolute path) to the root directory. When the go.mod is found, its module name and path will be returned.
func SnakeString ¶
SnakeString converts the string 's' to a snake string
func SplitGoTags ¶
func SplitPackage ¶
func SplitPackageName ¶
func SubPackage ¶
func SubPackageDir ¶
func ToCamelCase ¶
func ToGoFuncName ¶
ToGoFuncName converts a string to a function naming style for go
func ToHttpMethod ¶
func ToLowerCamelCase ¶
func ToSnakeCase ¶
func UnpackArgs ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.