https://github.com/jesusslim/dtcvt
golang data type convert
https://github.com/jesusslim/dtcvt
Last synced: 19 days ago
JSON representation
golang data type convert
- Host: GitHub
- URL: https://github.com/jesusslim/dtcvt
- Owner: jesusslim
- Created: 2016-03-03T08:41:13.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-03T09:04:50.000Z (over 9 years ago)
- Last Synced: 2025-03-15T04:26:59.654Z (4 months ago)
- Language: Go
- Size: 1000 Bytes
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dtcvt
golang data type convert## useage
package mainimport (
"fmt"
"github.com/jesusslim/dtcvt"
)func main() {
//to string
a := []byte("sa")
r := dtcvt.MustString(a, "gg")
fmt.Println("To string:", r)
//to int
b := 123
r2 := dtcvt.MustInt(b)
fmt.Println("To int:", r2)
//to float
c := []byte("12.7")
r3 := dtcvt.MustFloat64(c)
fmt.Println("To float:", r3)
}