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

Reason: 1. `ToStringSliceE` doesn't have unsigned integer slice support. #199

I used cast.ToStringSlice([]uint64{1,2,3,4}) to get a string slice, it didn't work... And it gave me a empty string slice.:(

I'd expect this test to pass: ```go func TestToFloat64NamedType(t *testing.T) { type X float64 f := ToFloat64(X(2)) if f != 2.0 { t.Fatalf("want %#v, got %#v", 2.0, f) } }...

Added a function to convert multiple types to []byte, considering Big and Little Endian as necessary options.

Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.1 to 4.1.0. Release notes Sourced from actions/setup-go's releases. v4.1.0 What's Changed In scope of this release, slow installation on Windows was fixed by @​dsame in actions/setup-go#393...

dependencies
github_actions

Fixes #176 by adding the `ToFloat64Slice()` and `ToFloat64SliceE()` helper functions.

Bumps [github.com/frankban/quicktest](https://github.com/frankban/quicktest) from 1.14.5 to 1.14.6. Commits 7c937a9 Merge pull request #162 from dolmen-go/update-README dfe325a Merge pull request #163 from frankban/improve-suppressed-output 1458145 Failure output: avoid using the 'same as' logic...

dependencies
go

cast.ToUint64E("18446744073709551615") // math.MaxUint64 will get err about value out of range. For ToUint64E, using strconv.ParseUint instead of strconv.ParseInt.

```golang func main() { fmt.Println(cast.ToInt64("1685517604534.995117")) } ``` result: 0