bytesize

package module
v0.0.0-...-c9e755d Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2017 License: MIT Imports: 1 Imported by: 1

Documentation

Overview

Package bytesize provides int64 wrapper type to aid with printing byte sizes in human friendly format.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes int64

Bytes type implements fmt.Stringer interface printing number of bytes in human-friendly form

Example
fmt.Println(B * 512)
fmt.Println(Bytes(-1024))
fmt.Println(KiB + B*500)
fmt.Println(5 * MiB)
Output:
512B
-1.00KiB
1.49KiB
5.00MiB
const (
	B Bytes = 1 << (10 * iota)
	KiB
	MiB
	GiB
	TiB
	PiB
	EiB
)

Constants for common sizes

func (Bytes) String

func (b Bytes) String() string

Jump to

Keyboard shortcuts

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