cast
cast copied to clipboard
safe and easy casting from one type to another in Go
we can use `ToStringMapString` convert ``` `{"key 1": "100", "key 2": -200, "key 3": 3.1415926}` ``` to ``` map[string]string{"key 1": "100", "key 2": "-200", "key 3": "3.1415926"} ```
Fixing https://github.com/spf13/cast/issues/102 Adding parsing UNIX timestamp from string
`panic: 2> unable to parse date: 1600285405` Code for reproduction: https://play.golang.org/p/yyxxFcFhQg1 ```golang package main import ( "fmt" cast "github.com/spf13/cast" ) func main() { val, err := cast.ToTimeE(1600285405) if err !=...
fix ToBoolE float64,float32,int,int64,int32,int16,int8,uint,uint64,uint32,uint16,uint8
 ToBoolE function can not recognize int64 nor int32, which result in false return I hope it will be fixed soon.
support cast string to string slice by comma ``` a b -> []string{"a", "b"} a,b -> []string{"a", "b"} a b,c -> []string{"a", "b,c"} ```
implementing an base 10 version of the `ToIntE` called `ToIntEBase10`
Fix ToBool() to support int32, int64, uint, uint32, uint64, float32, float64
This close #92