utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(path, content string) (err error)

func FindRootPath

func FindRootPath(absoluteFilePath, relativeFilePath string) string

func GetBuildGoPaths

func GetBuildGoPaths() []string

GetBuildGoPaths returns the list of Go path directories.

func GetGOPATH

func GetGOPATH() (gopath string, err error)

func GetIdlType

func GetIdlType(path string, pbName ...string) (string, error)

GetIdlType is used to return the idl type.

func GitClone

func GitClone(gitURL, path string) error

func GitPath

func GitPath(gitURL string) (string, error)

func Hessian2PostProcessing

func Hessian2PostProcessing(args args.Arguments)

Hessian2PostProcessing is responsible for performing hessian2-related post-processing. e.g. Replace *java.Object to java.Object Please refer to kitex/tool/cmd/kitex/main.go #NormalExit for detail.

func InitGoMod

func InitGoMod(module string) error

func IsHzNew

func IsHzNew(outputDir string) bool

func IsWindows

func IsWindows() bool

IsWindows determines whether the current operating system is Windows

func LookupTool

func LookupTool(idlType string) (string, error)

func PathExist

func PathExist(path string) (bool, error)

PathExist is used to judge whether the path exists in file system.

func ReadFileContent

func ReadFileContent(filePath string) (content []byte, err error)

func ReplaceThriftVersion

func ReplaceThriftVersion()

func SearchGoMod

func SearchGoMod(cwd string, recurse bool) (moduleName, path string, found bool)

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 SetHzVerboseLog

func SetHzVerboseLog(v bool)

func StringSliceSpilt

func StringSliceSpilt(s []string) []string

Types

type FlagStringSlice

type FlagStringSlice []string

func (*FlagStringSlice) Set

func (f *FlagStringSlice) Set(value string) error

func (*FlagStringSlice) String

func (f *FlagStringSlice) String() string

Jump to

Keyboard shortcuts

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