util

package
v0.0.0-...-43cec88 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contain

func Contain(obj interface{}, target interface{}) (bool, error)

Contain 判断obj是否在target中,target支持的类型arrary,slice,map

func Exist

func Exist(filename string) bool

Exist 检查文件或目录是否存在 如果由 filename 指定的文件或目录存在则返回 true,否则返回 false

func Filename

func Filename(file string) string

Filename returns the filename except ext

func IsDir

func IsDir(filename string) bool

IsDir 判断给定文件名是否是一个目录 如果文件名存在并且为目录则返回 true。如果 filename 是一个相对路径,则按照当前工作目录检查其相对路径。

func IsFile

func IsFile(filename string) bool

IsFile 判断给定文件名是否为一个正常的文件 如果文件存在且为正常的文件则返回 true

func ScanDir

func ScanDir(directory string) []string

ScanDir 列出指定路径中的文件和目录 如果目录不存在,则返回空 slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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