Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miaolz123/conver
Golang Type Reflect And Conver
https://github.com/miaolz123/conver
Last synced: about 2 months ago
JSON representation
Golang Type Reflect And Conver
- Host: GitHub
- URL: https://github.com/miaolz123/conver
- Owner: miaolz123
- License: mit
- Created: 2016-04-17T13:31:20.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-08-14T05:53:13.000Z (over 4 years ago)
- Last Synced: 2024-06-21T20:48:19.115Z (7 months ago)
- Language: Go
- Homepage: http://miaolz123.github.io/conver
- Size: 8.79 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# conver [![GoDoc](https://godoc.org/github.com/miaolz123/conver?status.svg)](https://godoc.org/github.com/miaolz123/conver) [![Build Status](https://travis-ci.org/miaolz123/conver.svg?branch=master)](https://travis-ci.org/miaolz123/conver)
### Golang Type Reflect And Conver
```go
package mainimport (
"fmt""github.com/miaolz123/conver"
)func main() {
val := "1 234.567\t\n"
fmt.Println(conver.Float64Must(val)) // output: 1234.567
fmt.Println(conver.IntMust(val)) // output: 1235
val = "ok"
fmt.Println(conver.BoolMust(val)) // output: true
fmt.Println(conver.Float64Must(val, 666.6)) // output: 666.6
fmt.Println(conver.IntMust(val, 6666)) // output: 666
}
```