From cbf01e118ab517ce7c15c56847d71ef99f564c87 Mon Sep 17 00:00:00 2001 From: renovate Date: Mon, 6 Apr 2020 20:28:57 +0000 Subject: [PATCH] Update github.com/c2h5oh/datasize commit hash to 28bbd47 (#212) Update github.com/c2h5oh/datasize commit hash to 28bbd47 Reviewed-on: https://kolaente.dev/vikunja/api/pulls/212 --- go.mod | 2 +- go.sum | 2 ++ vendor/github.com/c2h5oh/datasize/.travis.yml | 3 +++ vendor/github.com/c2h5oh/datasize/README.md | 27 +++++++++++++------ vendor/github.com/hashicorp/hcl/go.mod | 2 -- vendor/github.com/spf13/afero/go.mod | 2 -- vendor/github.com/spf13/viper/go.mod | 2 -- vendor/modules.txt | 2 +- 8 files changed, 26 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index ef72939f385..8516c944f4a 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a github.com/beevik/etree v1.1.0 // indirect - github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae + github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee github.com/client9/misspell v0.3.4 github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/cweill/gotests v1.5.3 diff --git a/go.sum b/go.sum index e0ec7e02af2..efe30f88f4c 100644 --- a/go.sum +++ b/go.sum @@ -42,6 +42,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLM github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae h1:2Zmk+8cNvAGuY8AyvZuWpUdpQUAXwfom4ReVMe/CTIo= github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= +github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee h1:BnPxIde0gjtTnc9Er7cxvBk8DHLWhEux0SxayC8dP6I= +github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= diff --git a/vendor/github.com/c2h5oh/datasize/.travis.yml b/vendor/github.com/c2h5oh/datasize/.travis.yml index a6ebc037cd8..204e70089fe 100644 --- a/vendor/github.com/c2h5oh/datasize/.travis.yml +++ b/vendor/github.com/c2h5oh/datasize/.travis.yml @@ -5,6 +5,9 @@ go: - 1.4 - 1.5 - 1.6 + - 1.7 + - 1.8 + - 1.9 - tip script: diff --git a/vendor/github.com/c2h5oh/datasize/README.md b/vendor/github.com/c2h5oh/datasize/README.md index d21f136b4d5..ac0cf8586e9 100644 --- a/vendor/github.com/c2h5oh/datasize/README.md +++ b/vendor/github.com/c2h5oh/datasize/README.md @@ -2,9 +2,10 @@ Golang helpers for data sizes - ### Constants + Just like `time` package provides `time.Second`, `time.Day` constants `datasize` provides: + * `datasize.B` 1 byte * `datasize.KB` 1 kilobyte * `datasize.MB` 1 megabyte @@ -14,7 +15,9 @@ Just like `time` package provides `time.Second`, `time.Day` constants `datasize` * `datasize.EB` 1 exabyte ### Helpers -Just like `time` package provides `duration.Nanoseconds() uint64 `, `duration.Hours() float64` helpers `datasize` has + +Just like `time` package provides `duration.Nanoseconds() uint64 `, `duration.Hours() float64` helpers `datasize` has. + * `ByteSize.Bytes() uint64` * `ByteSize.Kilobytes() float4` * `ByteSize.Megabytes() float64` @@ -26,7 +29,9 @@ Just like `time` package provides `duration.Nanoseconds() uint64 `, `duration.Ho Warning: see limitations at the end of this document about a possible precission loss ### Parsing strings + `datasize.ByteSize` implements `TextUnmarshaler` interface and will automatically parse human readable strings into correct values where it is used: + * `"10 MB"` -> `10* datasize.MB` * `"10240 g"` -> `10 * datasize.TB` * `"2000"` -> `2000 * datasize.B` @@ -36,28 +41,34 @@ Warning: see limitations at the end of this document about a possible precission * `"1 gigabyte"` -> `1 * datasize.GB` You can also do it manually: + ```go var v datasize.ByteSize err := v.UnmarshalText([]byte("100 mb")) ``` ### Printing -`Bytesize.String()` uses largest unit allowing an integer value: - * `(102400 * datasize.MB).String()` -> `"100GB"` - * `(datasize.MB + datasize.KB).String()` -> `"1025KB"` -Use `%d` format string to get value in bytes without a unit +`Bytesize.String()` uses largest unit allowing an integer value: + +* `(102400 * datasize.MB).String()` -> `"100GB"` +* `(datasize.MB + datasize.KB).String()` -> `"1025KB"` + +Use `%d` format string to get value in bytes without a unit. ### JSON and other encoding + Both `TextMarshaler` and `TextUnmarshaler` interfaces are implemented - JSON will just work. Other encoders will work provided they use those interfaces. ### Human readable + `ByteSize.HumanReadable()` or `ByteSize.HR()` returns a string with 1-3 digits, followed by 1 decimal place, a space and unit big enough to get 1-3 digits - * `(102400 * datasize.MB).String()` -> `"100.0 GB"` - * `(datasize.MB + 512 * datasize.KB).String()` -> `"1.5 MB"` +* `(102400 * datasize.MB).String()` -> `"100.0 GB"` +* `(datasize.MB + 512 * datasize.KB).String()` -> `"1.5 MB"` ### Limitations + * The underlying data type for `data.ByteSize` is `uint64`, so values outside of 0 to 2^64-1 range will overflow * size helper functions (like `ByteSize.Kilobytes()`) return `float64`, which can't represent all possible values of `uint64` accurately: * if the returned value is supposed to have no fraction (ie `(10 * datasize.MB).Kilobytes()`) accuracy loss happens when value is more than 2^53 larger than unit: `.Kilobytes()` over 8 petabytes, `.Megabytes()` over 8 exabytes diff --git a/vendor/github.com/hashicorp/hcl/go.mod b/vendor/github.com/hashicorp/hcl/go.mod index 3fdd02e2beb..4debbbe3580 100644 --- a/vendor/github.com/hashicorp/hcl/go.mod +++ b/vendor/github.com/hashicorp/hcl/go.mod @@ -1,5 +1,3 @@ module github.com/hashicorp/hcl require github.com/davecgh/go-spew v1.1.1 - -go 1.13 diff --git a/vendor/github.com/spf13/afero/go.mod b/vendor/github.com/spf13/afero/go.mod index ce1c3c53b9d..08685509957 100644 --- a/vendor/github.com/spf13/afero/go.mod +++ b/vendor/github.com/spf13/afero/go.mod @@ -1,5 +1,3 @@ module github.com/spf13/afero require golang.org/x/text v0.3.0 - -go 1.13 diff --git a/vendor/github.com/spf13/viper/go.mod b/vendor/github.com/spf13/viper/go.mod index 439d2d879ca..86e801c150b 100644 --- a/vendor/github.com/spf13/viper/go.mod +++ b/vendor/github.com/spf13/viper/go.mod @@ -22,5 +22,3 @@ require ( golang.org/x/text v0.3.0 // indirect gopkg.in/yaml.v2 v2.2.2 ) - -go 1.13 diff --git a/vendor/modules.txt b/vendor/modules.txt index 9a42594d935..3bb295c8e53 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -24,7 +24,7 @@ github.com/asaskevich/govalidator github.com/beevik/etree # github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 github.com/beorn7/perks/quantile -# github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae +# github.com/c2h5oh/datasize v0.0.0-20200112174442-28bbd4740fee github.com/c2h5oh/datasize # github.com/client9/misspell v0.3.4 github.com/client9/misspell