fmtutil

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OneKByte = 1024
	OneMByte = 1024 * 1024
	OneGByte = 1024 * 1024
)

data size

Variables

This section is empty.

Functions

func ArgsWithSpaces added in v0.3.8

func ArgsWithSpaces(args []interface{}) (message string)

ArgsWithSpaces it like Println, will add spaces for each argument

func DataSize

func DataSize(bytes uint64) string

DataSize format bytes number friendly.

Usage:

file, err := os.Open(path)
fl, err := file.Stat()
fmtSize := DataSize(fl.Size())

func HowLongAgo

func HowLongAgo(sec int64) string

HowLongAgo format a seconds, get how lang ago

func PrettyJSON added in v0.2.2

func PrettyJSON(v interface{}) (string, error)

PrettyJSON get pretty Json string

func StringsToInts added in v0.2.2

func StringsToInts(ss []string) (ints []int, err error)

StringsToInts string slice to int slice. alias of the arrutil.StringsToInts()

Types

This section is empty.

Jump to

Keyboard shortcuts

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