util

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dest string) (w int64, err error)

func FileExisted

func FileExisted(filename string) bool

FileExisted 检查文件是否存在

func Home

func Home() string

func HomeWithDir

func HomeWithDir(dir string) string

func IsDir

func IsDir(name string) bool

func MkdirIfNotExist

func MkdirIfNotExist(dir string) error

MkdirIfNotExist 创建目录

func ModulePath

func ModulePath(filename string) (string, error)

func ModuleVersion

func ModuleVersion(path string) (string, error)

ModuleVersion returns module version.

func PathExists

func PathExists(path string) (bool, error)

PathExists 检查路径是否存在

func Tree

func Tree(path string, dir string)

func ZelusMod

func ZelusMod() string

Types

type Repo

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

func NewRepo

func NewRepo(url, branch string) *Repo

func (*Repo) Clone

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

func (*Repo) CopyTo

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

func (*Repo) Path

func (r *Repo) Path() string

func (*Repo) Pull

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

Jump to

Keyboard shortcuts

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