Documentation ¶
Index ¶
- func Append(p string, b []byte) error
- func Copy(src, dst string) (err error)
- func CopyWithMode(src, dst string, mode os.FileMode) (err error)
- func DetectDir(dir string, features ...string) string
- func Exist(p string) bool
- func GoModPath() string
- func GoPath() string
- func GoSrcPath() string
- func IsDir(p string) bool
- func IsEmptyDir(p string) (bool, error)
- func IsFile(p string) bool
- func NotExist(p string) bool
- func OpenAppend(p string) (*os.File, error)
- func SourceDir() string
- func SourceFile() string
- type LogFile
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmptyDir ¶
func SourceDir ¶
func SourceDir() string
Example ¶
p := SourceDir() fmt.Println(strings.HasSuffix(filepath.ToSlash(p), `/fs`))
Output: true
func SourceFile ¶
func SourceFile() string
Example ¶
p := SourceFile() fmt.Println(strings.HasSuffix(filepath.ToSlash(p), `/fs/path_test.go`))
Output: true
Types ¶
type LogFile ¶
func NewLogFile ¶
Example ¶
f, err := NewLogFile("./a.txt") fmt.Println(f.path, f.File != nil, err)
Output: ./a.txt true <nil>
Click to show internal directories.
Click to hide internal directories.