cast icon indicating copy to clipboard operation
cast copied to clipboard

safe and easy casting from one type to another in Go

Results 110 cast issues
Sort by recently updated
recently updated
newest added

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

![image](https://user-images.githubusercontent.com/25901324/83851018-4e360800-a744-11ea-8aa5-5a1c536aeb3b.png) 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