util

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIfNotExist

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

CreateIfNotExist creates a file if it is not exists

func GetCurrentPath

func GetCurrentPath() (string, error)

GetCurrentPath get current folder path

func GetFileAbsPath

func GetFileAbsPath(filePath string) string

GetFileAbsPath get file abs path

func GetFileExt added in v0.1.3

func GetFileExt(filePath string) string

GetFileExt get current file ext

func GetFileFullName

func GetFileFullName(filePath string) string

GetFileFullName get current file full name

func GetFileName

func GetFileName(filePath string) string

GetFileName get current file name

func GetFolderAbsPath

func GetFolderAbsPath(filePath string) string

GetFolderAbsPath get folder path

func GetGoModulePath

func GetGoModulePath() (string, error)

GetGoModulePath get go module path from local

func GetGoPath

func GetGoPath() (string, error)

GetGoPath get go path from env

func Include

func Include(name string, list []string) bool

Include Is in the array

func IsFileExist

func IsFileExist(file string) bool

IsFileExist returns true if the specified file is exists

func IsFolderExist

func IsFolderExist(dir string) bool

IsFolderExist determine if a folder already exists

func MkdirIfNotExist

func MkdirIfNotExist(dir string) error

MkdirIfNotExist makes directories if the input path is not exists

func RemoveFolderIfExist

func RemoveFolderIfExist(dir string) error

RemoveFolderIfExist deletes the folder if it is exists

func RemoveIfExist

func RemoveIfExist(filename string) error

RemoveIfExist deletes the specified file if it is exists

Types

This section is empty.

Jump to

Keyboard shortcuts

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