Documentation ¶
Index ¶
- Variables
- func CheckedClose(c io.Closer, err error) error
- func CleanUp(dir string, err error) error
- func Concat(slices [][]byte) []byte
- func ConcatErrChan(errChan <-chan error, expected int) error
- func FilePathSansExt(path string) string
- func FilePathTrailingJoin(s ...string) string
- func NewNoNewlineWriter(w io.Writer) io.Writer
- func PathTrailingJoin(s ...string) string
- func StripTrace(e error) error
- func Uint64ToPosInt(i uint64) (o int, err error)
- type ConstReader
- type CounterWriter
- type Error
- type Errors
- type ResetReader
Constants ¶
This section is empty.
Variables ¶
var RemoveFunc = os.RemoveAll
RemoveFunc is the function to remove dir
Functions ¶
func CheckedClose ¶
CheckedClose may be called on defer to properly close a resource and log any errors
func ConcatErrChan ¶
ConcatErrChan concatenates all the errors in the channel into in a single error
func FilePathSansExt ¶
FilePathSansExt trims the extension from a file path
func FilePathTrailingJoin ¶
FilePathTrailingJoin is like filepath.Join but ensures there is a trailing seprator
func NewNoNewlineWriter ¶
NewNoNewlineWriter wrap a writer and filters out '\n' runes
func PathTrailingJoin ¶
PathTrailingJoin is like path.Join but ensures there is a trailing seprator
func StripTrace ¶
StripTrace cause the stack trace to not print on the error Not that it evaluates the Error() function
func Uint64ToPosInt ¶
Uint64ToPosInt convertes a uint64 to an int if it is positive as an int, returning an error otherwise
Types ¶
type CounterWriter ¶
CounterWriter is a writer that counts the number bytes written to it
type Error ¶
type Error struct { HasStack bool // contains filtered or unexported fields }
Error is an error type that may be used to turn off the stack trace
type ResetReader ¶
type ResetReader struct {
// contains filtered or unexported fields
}
ResetReader is an io.Reader that reads from r and calls resetfn every time Read() is called
func NewResetReader ¶
func NewResetReader(r io.Reader, f func()) *ResetReader
NewResetReader creates a new ResetReader that reads from r and calls resetfn every time Read() is called