base

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(dstPath string, srcPath string) error

Copy 复制文件 @param dstPath 复制内容到目标 @param srcPath 复制内容来源 @return error

func GoInstall

func GoInstall(path ...string) error

GoInstall go get path.

func GoToyHome

func GoToyHome() string

func GoToyHomeWithDir

func GoToyHomeWithDir(dir string) string

func ModulePath

func ModulePath(filename string) (string, error)

ModulePath returns go module path.

func Replace

func Replace(path, old, new string)

Replace 替换某个文件夹下所有文件的某个字符串 @param path 文件夹路径 @param old 将被替换的字符串 @param new 新的字符串

func StringFirstLower

func StringFirstLower(s string) string

StringFirstLower 字符串首字母小写

func StringFirstUpper

func StringFirstUpper(s string) string

StringFirstUpper 字符串首字母大写

func Tree

func Tree(path string, dir string)

Types

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

Repo is git repository manager.

func NewRepo

func NewRepo(url string, branch string) *Repo

NewRepo new a repository manager.

func (*Repo) Clone

func (r *Repo) Clone(ctx context.Context) error

Clone clones the repository to cache path.

func (*Repo) CopyTo

func (r *Repo) CopyTo(ctx context.Context, to string, modPath string, ignores []string) error

CopyTo copies the repository to project path.

func (*Repo) Path

func (r *Repo) Path() string

Path returns the repository cache path.

func (*Repo) Pull

func (r *Repo) Pull(ctx context.Context) error

Pull fetch the repository from remote url.

Jump to

Keyboard shortcuts

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