This is package golang for convert interface into any data type
- get package
go get github.com/mufti1/interconv/package
- import
import "github.com/mufti1/interconv/package"
- use
var i interface{}
// example for float64
// you can use error return if you need it
numFloat64 , _ := interconv.ParseFloat64(i)
Completed and open to update
- Int
- Int8
- Int32
- Int16
- Int64
- Float32
- Float64
- Boolean
- String
- Uint
- Uint8
- Uint16
- Uint32
- Uint64
- Uintptr
it is released under the MIT license. See LICENSE.