utils

package
v0.0.0-...-3edb9e0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirExists

func DirExists(path string) bool

Test if a dir exists. (if the target is a file, the function returns false)

func DirectorySize

func DirectorySize(dir string) (int64, error)

Use unix "du" command to get directory disk usage

func F2S

func F2S(f float64) string

Convert float64 => string

func FileExists

func FileExists(path string) bool

Test if a file exists. (if the target is a dir, the function returns false)

func FileReadAll

func FileReadAll(filepath string) (string, error)

Return the file content in a string.

func FileReadAllBytes

func FileReadAllBytes(filepath string) ([]byte, error)

Return the file content in a []byte.

func FileWriteAll

func FileWriteAll(filepath, content string) error

Write a string in a file.

func FileWriteAllBytes

func FileWriteAllBytes(filepath string, content []byte) error

Write a []byte in a file.

func I2S

func I2S(i int) string

Convert int => string

func S2F

func S2F(s string) (float64, error)

Convert string => float64

func S2I

func S2I(s string) (int, error)

Convert string => int

Types

This section is empty.

Jump to

Keyboard shortcuts

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