Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jesusslim/dtcvt
golang data type convert
https://github.com/jesusslim/dtcvt
Last synced: about 1 month ago
JSON representation
golang data type convert
- Host: GitHub
- URL: https://github.com/jesusslim/dtcvt
- Owner: jesusslim
- Created: 2016-03-03T08:41:13.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-03T09:04:50.000Z (almost 9 years ago)
- Last Synced: 2024-06-20T00:36:29.555Z (6 months ago)
- Language: Go
- Size: 1000 Bytes
- Stars: 2
- Watchers: 2
- 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)
}