Documentation ¶
Index ¶
- func CombineOutputPath(outputPath, ns string) string
- func DownloadFile(remotePath, localPath string) error
- func Exists(path string) bool
- func FormatCode(code []byte) ([]byte, error)
- func GetGOPATH() string
- func JoinPath(elem ...string) string
- func LowerFirst(s string) string
- func NotPtr(s string) string
- func ReadInput() ([]byte, error)
- func ReplaceString(s, old, new string, n int) string
- func RunGitCommand(gitLink string) (string, string, error)
- func SearchGoMod(cwd string) (moduleName, path string, found bool)
- func SnakeString(s string) string
- func UpperFirst(s string) string
- type StringSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineOutputPath ¶ added in v0.5.0
CombineOutputPath read the output and path variables and render them into the final path
func DownloadFile ¶ added in v0.8.0
DownloadFile Download file to local
func GetGOPATH ¶
func GetGOPATH() string
GetGOPATH retrieves the GOPATH from environment variables or the `go env` command.
func LowerFirst ¶
LowerFirst converts the first letter to upper case for the given string.
func ReadInput ¶ added in v0.8.0
ReadInput defaults to read from stdin. If `KITEX_TOOL_STDIN_LOAD_FILE` is a valid path, it reads from the specified file; If `KITEX_TOOL_STDIN_DUMP_FILE` is a valid path, it dumps what it read to the file; This feature makes it easier to debug kitex tool.
func ReplaceString ¶ added in v0.5.0
ReplaceString be used in string substitution.
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 ¶ added in v0.5.0
SnakeString converts the string 's' to a snake string
func UpperFirst ¶
UpperFirst converts the first letter to upper case for the given string.
Types ¶
type StringSlice ¶
type StringSlice []string
StringSlice implements the flag.Value interface on string slices to allow a flag to be set multiple times.
func (*StringSlice) Set ¶
func (ss *StringSlice) Set(value string) error
Set implements the flag.Value interface.
func (*StringSlice) String ¶
func (ss *StringSlice) String() string