Version: v1.4.0 Latest Latest

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

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 5 Imported by: 0



Package io provides file or directory io utilities.



This section is empty.


This section is empty.


func BaseDir

func BaseDir(s string) string

BaseDir get base dir from a path /a/b/c.ext => /a/b /a/b/c => /a/b

func Basename

func Basename(s string) string

Basename get the base name from a path /a/b/c.ext => /a/b/c

func CallerInfo added in v0.5.3

func CallerInfo(skip int) (file string, line int, fn string)

CallerInfo get call info, include filename, line number or function name

func ChangeWorkDir

func ChangeWorkDir(workDir string) error

ChangeWorkDir change current working dir

func CreateFile

func CreateFile(path, filename string) error

CreateFile create file

func DirName

func DirName(s string) string

DirName get dir name from a path /a/b/c => c

func EnsureWorkDir

func EnsureWorkDir(skip int, dir string) (ok bool)

EnsureWorkDir ensure the working dir is set the correct dir specified by user

func Filename

func Filename(s string) string

Filename get file name from a path /a/b/c.ext => c.ext

func GetRelativePath

func GetRelativePath(level int) string

GetRelativePath get relative path

func GetWorkDir

func GetWorkDir() string

GetWorkDir get current working dir

func IsPathNotExist

func IsPathNotExist(path string) bool

IsPathNotExist check if path is not exist

func Visit

func Visit(files *[]string) filepath.WalkFunc

Visit get files in a specific dir

func WriterFile

func WriterFile(path, filename string, in []byte) (int, error)

WriterFile write bytes to file


This section is empty.

Source Files

Jump to

Keyboard shortcuts

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