梁 致源
d23e8d28a6
更新 'go.mod'
před 3 roky
梁 致源
3ab4c71a58
更新 'README.md'
před 3 roky
K4rian
1ffadf5510
Fix uint, uint8, uint16, uint32 and uint64 conversion in ToStringE function.
před 4 roky
Bjørn Erik Pedersen
c01685bb84
travis: Only check gofmt on Go 1.12
před 4 roky
Bjørn Erik Pedersen
a924560ecf
travis: Add Go 1.12
před 4 roky
Bjørn Erik Pedersen
8c9545af88
Fix Travis build
před 5 roky
Bjørn Erik Pedersen
76b6d6c500
Add go.mod
před 5 roky
Bjørn Erik Pedersen
97e58d71a3
Update Travis config
před 5 roky
Theofanis Despoudis
4dd38b8b57
Add support for map of int64 and map of int
před 5 roky
Ben Orchard
efb632f0f6
tests: +date tests for RFC3339 no TZ colon cases
před 5 roky
Ben Orchard
8934aa3ddd
StringToDate: +more RFC3339 forms without TZ colon
Adds a form to handle the common format `strftime("%FT%T%z")`, which
omits the (optional) colon from the timezone. Also adds a matching
T-omitted form.
před 5 roky
Xavier Vello
8965335b8c
Add TestToDurationSliceE cases to reach 100% coverage
před 6 roky
Xavier Vello
9ebc15c905
Add support for maps defined as a json string
před 6 roky
Roman Volosatovs
acbeb36b90
Add ToDurationSlice()
před 7 roky
Cameron Moore
ce135a4ebe
Add Travis CI
před 7 roky
Cameron Moore
816e3433fe
Small simplifications
před 7 roky
Cameron Moore
1ad7d3c5ed
Use single defined error for negatives
před 7 roky
Cameron Moore
758cd85768
Error on unsigned conversions of negative values
před 7 roky
Cameron Moore
d37435d953
Add additional type conversions
Adds float32, uint, uint64, uint32, uint16, and uint8 throughout.
Fixes #33
před 7 roky
Cameron Moore
df9611b942
Refactor tests to get full coverage
Test coverage goes from 75.6% to 100%
před 7 roky
Cameron Moore
4f1683a224
Update and standardize error messages
před 7 roky
Cameron Moore
1dfd38810f
Fix issues found by gosimple
před 7 roky
Cameron Moore
e71c5a68f1
Update godoc comments
před 7 roky
Cameron Moore
2c719d95d6
Fix gofmt and golint errors
před 7 roky
Cameron Moore
55be5581bd
Add godoc and report card badges to README
před 7 roky
Cameron Moore
10b6280cf2
Add Makefile
před 7 roky
chyeh
e4f8127058
Add `ToInt8`, `ToInt16` and `ToInt32`
před 7 roky
Cameron Moore
f820543c35
Fix regression in StringToDate
In commit d1139ba, I removed a date format for "RFC3339 without T" that
I misidentified as a reduntant format. This commit adds it back with a
test.
před 7 roky
Cameron Moore
d1139bab1c
Add missing time formats and tests
Add missing time formats, remove duplicate formats, and test all
supported formats.
před 7 roky
Cameron Moore
56a7ecbeb1
Add Unix epoch support to ToTimeE
před 7 roky
emacsist
24b6558033
Add "yyyy-MM-dd HH:mm:ss" string format
před 7 roky
Bjørn Erik Pedersen
2580bc98dc
Remove expensive TRACE logging
```
benchmark old ns/op new ns/op delta
BenchmarkTooBool-4 2671 67.8 -97.46%
benchmark old allocs new allocs delta
BenchmarkTooBool-4 3 1 -66.67%
benchmark old bytes new bytes delta
BenchmarkTooBool-4 49 1 -97.96%
```
před 7 roky
Bjørn Erik Pedersen
7c3adfba29
Add benchmark for ToBool
```
BenchmarkTooBool-4 500000 2781 ns/op 49 B/op 3 allocs/op
```
před 7 roky
M@
60e7a69a42
Add ToBoolSlice()
Fixes #1
před 7 roky
Chih-Hung Yeh
fa673d63c1
Fixe `ToDurationE()`
It used to return zero valeus in some cases. The details are described
in [this issue](https://github.com/spf13/viper/issues/203 ). More cases
were also added in the unit test `TestToDuration()`
před 7 roky
Feng
4532b05430
FIx ToStringMapStringSliceE
* Update caste.go
bug fix
json config, for example:
{ "test" : ["abc", "123"] }
* update test
před 7 roky
Bjørn Erik Pedersen
e31f36ffc9
Log the To* invocations as TRACE
It gets very chatty at DEBUG.
před 7 roky
Bjørn Erik Pedersen
27b586b42e
Add support for the other html template types
před 8 roky
Matt Keller
0eed3d1b35
Add a ToInt64() and necessary plumbing
před 8 roky
Matt Keller
7c7add0129
Add ability to cast int64's to strings
Resolves #18
před 8 roky
Cyrill Schumacher
ee7b3e0353
Add bool case to ToStringE
před 8 roky
Tyler Power
6770a32f65
Add int64 and float64 type coercion in ToDuration
před 8 roky
Jeff Hodges
ee815aaf95
add date formats found in jekyll posts
The first added is definitely in jekyll. The second, I believe, happens,
too.
před 8 roky
jackspirou
1c4ba956f5
adding back default statements and adding comments and cleanups
před 8 roky
jackspirou
d7ba796a5f
adding unit tests for ToStringMapString and ToStringMapStringSlice methods
před 8 roky
jackspirou
7ed57e5c41
adding ToStringMapStringSlice method
před 8 roky
bep
893a4154d1
Add support for template.URL
Fixes #13
před 9 roky
bep
4d07383ffe
Make ToIntSliceE more flexible
Now it accepts any slice or array type that contains a type supported by ToIntE.
[close #12 ]
před 9 roky
bep
2c4fdb5416
Add ToIntSlice
před 9 roky
Chance Zibolski
3cc9db95ac
Add ToDuration
před 9 roky