Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsString(str []string, elem string) bool
- func Exist(filename string) bool
- func Float642String(num float64, saveDecimalPoint int) string
- func FormatFloat(i float64, size int) string
- func GenerateUUID() string
- func GetAllFiles(dirPth string, filter FilterFile) ([]string, error)
- func GetFileAbsPath(path string) (string, error)
- func GetFilePrefixAndSuffix(filename string) (prefix, suffix string)
- func GetFileRelativePath(fileName string, path string) (string, error)
- func GetGoPath() string
- func GetGoProjectDir() string
- func LinesToString(lines []string) string
- func NewString(elem byte, len int) string
- func ReadLineByFunc(file io.Reader, foo func(line string) error) error
- func ReadLines(read io.Reader) ([]string, error)
- func Slug(str string) string
- func SplitSliceString(slice []string, length int) [][]string
- func TimeToSeconds(duration time.Duration) string
- func ToJsonString(v interface{}) string
- func ToPrettyJsonString(v interface{}) string
- func ToString(value interface{}) string
- func UnsafeBytes(data string) []byte
- func UnsafeString(data []byte) string
- type FilterFile
Constants ¶
View Source
const ( DefaultFileMode os.FileMode = 0644 DefaultDirMode os.FileMode = 0755 FileSeparator = filepath.Separator )
View Source
const ( FormatTimeV1 = "2006-01-02 15:04:05" FormatTimeV2 = "2006/1-2" )
Variables ¶
View Source
var (
FormatPrettyJson = prettyjson.Format
)
Functions ¶
func ContainsString ¶
func Float642String ¶
Float642String 除固定值,保留固定小数位.
func FormatFloat ¶
func GenerateUUID ¶
func GenerateUUID() string
func GetAllFiles ¶
func GetAllFiles(dirPth string, filter FilterFile) ([]string, error)
GetAllFiles 从路径dirPth下获取全部的文件.
func GetFileAbsPath ¶
func GetFilePrefixAndSuffix ¶
func GetFileRelativePath ¶
GetFileRelativePath fileName指的是文件的路径 path 指的是文件的父路径地址,return 相对路径.
func LinesToString ¶
func SplitSliceString ¶
func TimeToSeconds ¶
TimeToSeconds 时间之差 s 输出 0.100010s.
func ToJsonString ¶
func ToJsonString(v interface{}) string
func ToPrettyJsonString ¶
func ToPrettyJsonString(v interface{}) string
func UnsafeBytes ¶
func UnsafeString ¶
Types ¶
type FilterFile ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
prettyjson
* COPY https://github.com/hokaccha/go-prettyjson/blob/master/prettyjson.go Package prettyjson provides JSON pretty print.
|
* COPY https://github.com/hokaccha/go-prettyjson/blob/master/prettyjson.go Package prettyjson provides JSON pretty print. |
unsafe
Package unsafeConvert provides functions for unsafely convert between a string and a slice of bytes.
|
Package unsafeConvert provides functions for unsafely convert between a string and a slice of bytes. |
Click to show internal directories.
Click to hide internal directories.