util

package
v0.24.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) (err error)

copied from http://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherwise, attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.

func Debugf added in v0.23.3

func Debugf(format string, args ...interface{})

Using this in place of Printf statements makes it easier to find any errant debug statements and the switch means we can turn them off at minimal runtime cost.

func EnsureDir

func EnsureDir(dir string, mode os.FileMode) error

Ensure the directory exists or create it if needed.

func Fatalf added in v0.16.0

func Fatalf(format string, args ...interface{})

Prints an error message to stderr and exits with status code 1

func IsDir

func IsDir(directory string) bool

Check whether the provided directory exists

Types

This section is empty.

Directories

Path Synopsis
logging
cmd
snatives

Jump to

Keyboard shortcuts

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