fsutil

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SI = 1000
	KB = SI
	MB = SI * KB
	GB = SI * MB
	TB = SI * GB
)

Variables

This section is empty.

Functions

func ReadableMemorySize

func ReadableMemorySize[T Number](bytes T) string

ReadableMemorySize returns a prettier form of some memory size expressed in bytes. Note: Do not exceed the float64 limit, as the result will overflow.

func ValidateFilename

func ValidateFilename(filename string) bool

ValidateFilename checks the validity of a filename.

Types

type Number

type Number interface {
	uint | uint16 | uint32 | uint64 | int | int16 | int32 | int64
}

Jump to

Keyboard shortcuts

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