Documentation ¶
Index ¶
- func CopyFile(dst, src string) error
- func CreateDirForFile(path string) error
- func CreateDirForFileMust(path string) string
- func CreateDirIfNotExists(path string) error
- func CreateDirIfNotExistsMust(dir string) string
- func CreateDirMust(path string)
- func CreateZipWithDirContent(zipFilePath, dirToZip string) error
- func DirifyFileName(fn string) string
- func DurationToString(d time.Duration) string
- func ExpandTildeInPath(s string) string
- func GetFileSize(path string) (int64, error)
- func IsLinux() bool
- func IsMac() bool
- func ListFilesInDir(dir string, recursive bool) []string
- func PanicIf(cond bool, args ...interface{})
- func PanicIfErr(err error)
- func PathExists(path string) bool
- func PathIsDir(path string) (isDir bool, err error)
- func ReadLinesFromFile(path string) ([]string, error)
- func ReadLinesFromReader(r io.Reader) ([]string, error)
- func Sha1HexOfBytes(data []byte) string
- func Sha1HexOfFile(path string) (string, error)
- func Sha1OfBytes(data []byte) []byte
- func Sha1OfFile(path string) ([]byte, error)
- func TimeSinceNowAsString(t time.Time) string
- func UserHomeDir() string
- func WriteBytesToFile(d []byte, path string) error
- type Semaphore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirForFile ¶
func CreateDirForFileMust ¶
func CreateDirIfNotExists ¶
func CreateDirMust ¶
func CreateDirMust(path string)
func CreateZipWithDirContent ¶
the names of files inside the zip file are relatitve to dirToZip e.g. if dirToZip is foo and there is a file foo/bar.txt, the name in the zip will be bar.txt
func DirifyFileName ¶
func DurationToString ¶
func ExpandTildeInPath ¶
func GetFileSize ¶
func ListFilesInDir ¶
func PanicIfErr ¶
func PanicIfErr(err error)
func PathExists ¶
treats any error (e.g. lack of access due to permissions) as non-existence
func PathIsDir ¶
Returns true, nil if a path exists and is a directory Returns false, nil if a path exists and is not a directory (e.g. a file) Returns undefined, error if there was an error e.g. because a path doesn't exists
func ReadLinesFromFile ¶
func Sha1HexOfBytes ¶
func Sha1HexOfFile ¶
func Sha1OfBytes ¶
func Sha1OfFile ¶
func TimeSinceNowAsString ¶
func UserHomeDir ¶
func UserHomeDir() string
func WriteBytesToFile ¶
Types ¶
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
based on http://golang.org/doc/effective_go.html#channels
func NewSemaphore ¶
Click to show internal directories.
Click to hide internal directories.