Documentation ¶
Index ¶
- func GetImportPath(filePath string) string
- func GetModPath() string
- func GoFmt(path string)
- func GoModTidy(ctx context.Context, dirPath string) error
- func HTTPDownloadFileWithPercent(url string, localSaveFilePath string) error
- func IsFileDoNotEdit(filePath string) bool
- func ReplaceGeneratedContentGFV2(folderPath string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetImportPath ¶
GetImportPath calculates and returns the golang import path for given `filePath`. Note that it needs a `go.mod` in current working directory or parent directories to detect the path.
func GetModPath ¶
func GetModPath() string
GetModPath retrieves and returns the file path of go.mod for current project.
func GoFmt ¶
func GoFmt(path string)
GoFmt formats the source file and adds or removes import statements as necessary.
func HTTPDownloadFileWithPercent ¶
HTTPDownloadFileWithPercent downloads target url file to local path with percent process printing.
func IsFileDoNotEdit ¶
IsFileDoNotEdit checks and returns whether file contains `do not edit` key.
func ReplaceGeneratedContentGFV2 ¶
ReplaceGeneratedContentGFV2 replaces generated go content from goframe v1 to v2.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.