A simple golang library to handle memory or disk size
Go to file
Lunny Xiao 40ea84d72f
All checks were successful
continuous-integration/drone/push Build is passing
fix README
2019-06-26 16:36:11 +08:00
.drone.yml add drone file 2019-06-26 16:10:59 +08:00
go.mod add drone file 2019-06-26 16:10:59 +08:00
go.sum add drone file 2019-06-26 16:10:59 +08:00
LICENSE init project 2018-04-22 10:13:18 +08:00
README.md fix README 2019-06-26 16:36:11 +08:00
size_test.go test error content 2018-04-22 10:48:17 +08:00
size.go test error content 2018-04-22 10:48:17 +08:00

Size

Build Status

Package size is a simple package to handle memory or disk size calculation or format

Installation

go get github.com/lunny/size

Usage

import (
    "fmt"

    . "github.com/lunny/size"
)

func main() {
    fmt.Println(10*M)

    size, _ := ParseSize("1.2K")
    fmt.Println(size)
}