files

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 11 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(source, destination string) error

Copy source to destination path: if destination is a directory, source will be copied in the dir with the file basename.

func CopyDir

func CopyDir(src string, dst string) error

CopyDir copies a whole directory recursively overwriting contents

func EachLine

func EachLine(path string, walkFn EachLineFunc) error

EachLine walks lines, calling EachLineFunc for each line of the file. All errors that arise visiting lines are filtered by callback function.

func Exists

func Exists(filepath string) bool

Exists reports whether the named file or directory exists.

func IsDir

func IsDir(fpath string) bool

IsDir reports whether d is a directory.

func IsRegular

func IsRegular(fpath string) bool

IsRegular reports whether filepath is a regular file.

func IsSamePath

func IsSamePath(p1 string, p2 string) bool

IsSamePath returns true if two different strings refer to the same file.

func IsSymlink(path string) bool

IsSymlink returns if a given file is a symbolic link on a Unix like OS or false if the OS is Windows

func ReadLines

func ReadLines(path string) ([]string, error)

ReadLines returns a slice containing file lines.

func Sha1Sum

func Sha1Sum(fpath string) (string, error)

Sha1Sum gives the checksum for the given file

Types

type EachLineFunc

type EachLineFunc func(line string) error

EachLineFunc is definition of callback

Jump to

Keyboard shortcuts

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