Package strparse provides tools for parsing strings and returning basic Go types, for the Go programming language.
- Go 100%
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| mustparse.go | ||
| parse.go | ||
| parseelse.go | ||
| parseok.go | ||
| parseok_test.go | ||
| README.md | ||
| type.go | ||
go-strparse
Package strparse provides tools for parsing strings and returning basic Go types, for the Go programming language.
Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-strparse
Examples
Here is an example of trying to parse a string and returning a uint16:
tcpport, error := strparse.Parse[uint16]("1234")
Here is an example of trying to parse a string and returning a uint16,
but if the string doesn't represent a uint16 number, then defaulting it to 8080:
tcpport := strparse.ParseElse[uint16]("1234", 8080)
Import
To import package strparse use import code like the following:
import "github.com/reiver/go-strparse"
Installation
To install package strparse do the following:
GOPROXY=direct go get github.com/reiver/go-strparse
Author
Package strparse was written by Charles Iliya Krempeaux