Documentation ¶
Overview ¶
Package must provides fatal wrappers for common stdlib functions.
Index ¶
- Variables
- func Atoi(buf []byte) int
- func Close(f io.Closer)
- func Create(name string) *os.File
- func Decode(e Decoder, v interface{})
- func Encode(e Encoder, v interface{})
- func FatalIf(err error)
- func MarshalJSON(v interface{}) []byte
- func NoErr(err error)
- func Open(name string) *os.File
- func OpenFile(name string, flag int, perm os.FileMode) *os.File
- func PanicIf(err error)
- func Read(r io.Reader, buf []byte) (n int)
- func ReadAll(f io.Reader) []byte
- func ReadDir(dirname string) []os.FileInfo
- func ReadFile(name string) []byte
- func ReadFull(f io.Reader, buf []byte) int
- func Remove(name string)
- func Rename(oldpath, newpath string)
- func Seek(f io.Seeker, offset int64, whence int) int64
- func Stat(f *os.File) os.FileInfo
- func StatPath(name string) os.FileInfo
- func Sync(f *os.File)
- func TempDir(dir, prefix string) string
- func TempFile(dir, prefix string) *os.File
- func Truncate(f *os.File, size int64)
- func TruncatePath(name string, size int64)
- func UnmarshalJSON(data []byte, v interface{})
- func Write(f io.Writer, b []byte) int
- func WriteAt(f io.WriterAt, b []byte, off int64) int
- func WriteFile(name string, buf []byte, perm os.FileMode)
- type Decoder
- type Encoder
Constants ¶
This section is empty.
Variables ¶
View Source
var AbortIf = FatalIf
AbortIf should point to FatalIf or PanicIf or similar user-provided function which will interrupt execution in case it's param is not nil.
Functions ¶
func Decode ¶
func Decode(e Decoder, v interface{})
Decode is a wrapper for json.Decoder.Decode, gob.Decoder.Decode, xml.Decoder.Decode, …
func Encode ¶
func Encode(e Encoder, v interface{})
Encode is a wrapper for json.Encoder.Encode, gob.Encoder.Encode, xml.Encoder.Encode, …
func FatalIf ¶
func FatalIf(err error)
FatalIf will call log.Fatal(err) in case given err is not nil.
func MarshalJSON ¶
func MarshalJSON(v interface{}) []byte
MarshalJSON is a wrapper for json.Marshal.
func TruncatePath ¶
TruncatePath is a wrapper for os.Truncate.
func UnmarshalJSON ¶
func UnmarshalJSON(data []byte, v interface{})
UnmarshalJSON is a wrapper for json.Unmarshal.
Types ¶
Click to show internal directories.
Click to hide internal directories.