util

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(file string) (*os.File, error)

Create Creates or truncates the named file,if the file path contains directories, it will make them first.

func EqualLengthPrint added in v1.0.3

func EqualLengthPrint(str1 string, str2 string, maxLen int)

EqualLengthPrint 等长打印:青色

func FileExists

func FileExists(file string) bool

FileExists checks whether a file exists.

func FileExistsOrCreate

func FileExistsOrCreate(dir string) error

文件是否存在,不存递归创建文件夹

func GetDirs

func GetDirs(dirPath string) (dirs []string, err error)

GetDirs 获取文件夹下所有文件夹路径

func GetGiteeProjectTag

func GetGiteeProjectTag(owner, repo string) (string, error)

func GetModuleName

func GetModuleName() (string, error)

GetModuleName 获取go.mod文件里的module名称

func GetPbAlias

func GetPbAlias(pbPath string) string

根据pbPath获取pb别名字段

func GetPbFiles

func GetPbFiles(dirPath string) ([]string, error)

GetPbFiles 获取所有pb文件路径

func GetProtoFiles

func GetProtoFiles(dirPath string) ([]string, error)

GetProtoFiles 获取所有proto文件路径

func GoFormat

func GoFormat(file string) error

GoFormat formats go file in canonical gofmt style and fix import statements.

func GoInstallCmd

func GoInstallCmd(arg string) ([]byte, error)

GoInstallCmd 初始化必需类库

func OpenOrCreate

func OpenOrCreate(file string) (*os.File, error)

OpenOrCreate opens a file if it exists, otherwise creates it. If the file path contains directories, it will make them first.

func PrintC

func PrintC(l, i int)

PrintC 打印进度

func PrintError

func PrintError(err error)

func PrintSuccess

func PrintSuccess(input string)

Types

type GiteeTagResp

type GiteeTagResp struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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