K4rian
1ffadf5510
Fix uint, uint8, uint16, uint32 and uint64 conversion in ToStringE function.
пре 4 година
Bjørn Erik Pedersen
8c9545af88
Fix Travis build
пре 5 година
Theofanis Despoudis
4dd38b8b57
Add support for map of int64 and map of int
пре 5 година
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.
пре 5 година
Xavier Vello
9ebc15c905
Add support for maps defined as a json string
пре 6 година
Roman Volosatovs
acbeb36b90
Add ToDurationSlice()
пре 7 година
Cameron Moore
816e3433fe
Small simplifications
пре 7 година
Cameron Moore
1ad7d3c5ed
Use single defined error for negatives
пре 7 година
Cameron Moore
758cd85768
Error on unsigned conversions of negative values
пре 7 година
Cameron Moore
d37435d953
Add additional type conversions
Adds float32, uint, uint64, uint32, uint16, and uint8 throughout.
Fixes #33
пре 7 година
Cameron Moore
4f1683a224
Update and standardize error messages
пре 7 година
Cameron Moore
1dfd38810f
Fix issues found by gosimple
пре 7 година
Cameron Moore
e71c5a68f1
Update godoc comments
пре 7 година
chyeh
e4f8127058
Add `ToInt8`, `ToInt16` and `ToInt32`
пре 7 година
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.
пре 7 година
Cameron Moore
d1139bab1c
Add missing time formats and tests
Add missing time formats, remove duplicate formats, and test all
supported formats.
пре 7 година
Cameron Moore
56a7ecbeb1
Add Unix epoch support to ToTimeE
пре 7 година
emacsist
24b6558033
Add "yyyy-MM-dd HH:mm:ss" string format
пре 7 година
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%
```
пре 7 година
M@
60e7a69a42
Add ToBoolSlice()
Fixes #1
пре 7 година
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()`
пре 7 година
Feng
4532b05430
FIx ToStringMapStringSliceE
* Update caste.go
bug fix
json config, for example:
{ "test" : ["abc", "123"] }
* update test
пре 7 година
Bjørn Erik Pedersen
e31f36ffc9
Log the To* invocations as TRACE
It gets very chatty at DEBUG.
пре 7 година
Bjørn Erik Pedersen
27b586b42e
Add support for the other html template types
пре 8 година
Matt Keller
0eed3d1b35
Add a ToInt64() and necessary plumbing
пре 8 година
Matt Keller
7c7add0129
Add ability to cast int64's to strings
Resolves #18
пре 8 година
Cyrill Schumacher
ee7b3e0353
Add bool case to ToStringE
пре 8 година
Tyler Power
6770a32f65
Add int64 and float64 type coercion in ToDuration
пре 8 година
Jeff Hodges
ee815aaf95
add date formats found in jekyll posts
The first added is definitely in jekyll. The second, I believe, happens,
too.
пре 8 година
jackspirou
1c4ba956f5
adding back default statements and adding comments and cleanups
пре 8 година
jackspirou
d7ba796a5f
adding unit tests for ToStringMapString and ToStringMapStringSlice methods
пре 8 година
jackspirou
7ed57e5c41
adding ToStringMapStringSlice method
пре 8 година
bep
893a4154d1
Add support for template.URL
Fixes #13
пре 9 година
bep
4d07383ffe
Make ToIntSliceE more flexible
Now it accepts any slice or array type that contains a type supported by ToIntE.
[close #12 ]
пре 9 година
bep
2c4fdb5416
Add ToIntSlice
пре 9 година
Chance Zibolski
3cc9db95ac
Add ToDuration
пре 9 година
Chance Zibolski
dace11d497
Use strings.Fields
пре 9 година
Chance Zibolski
b24b4ff690
ToStringSliceE: Support string values
пре 9 година
spf13
2318c5caf2
Add support for pointers to basic types
пре 9 година
spf13
421411cf35
Add proper support for error -> string and Stringer -> string.
пре 9 година
Derek Perkins
c0388c79a0
Defaulted .ToStringE to use reflection to find a stringer element
пре 9 година
bep
0a58809502
Add support for HTML to String
пре 9 година
txgruppi
ed6dd5ade6
Updated to return bool false only for zero
пре 9 година
bep
bbe2d4b35d
Add ToStringMapBool
ToStringMapBool is useful for a map of flags in a configuration file.
пре 9 година
Asdine El Hrychy
770890fb15
Removed forgotten fmt.Println("here")
пре 9 година
Romain Baugue
075c75a269
Added ToBool case for string, and added ToBool test cases
пре 9 година
spf13
99f1223ff6
Adding ToSlice
пре 10 година
spf13
d578378de0
Caste now returns error instead of bool.
пре 10 година
spf13
b252e9f21d
Handling another case (map[string]interface{})
пре 10 година
spf13
5a9b0d4cc3
adding Int to Float. Testing for float
пре 10 година