Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

README

        

# dtcvt
golang data type convert

## useage

package main

import (
"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)
}