go-arg/vendor/github.com/alexflint/go-scalar
Alex Flint d7246f2485 go mod vendor 2018-11-20 12:09:59 -08:00
..
.gitignore use go-scalar, vendoring 2017-02-15 18:19:41 -08:00
.travis.yml use go-scalar, vendoring 2017-02-15 18:19:41 -08:00
LICENSE use go-scalar, vendoring 2017-02-15 18:19:41 -08:00
README.md use go-scalar, vendoring 2017-02-15 18:19:41 -08:00
go.mod go mod vendor 2018-11-20 12:09:59 -08:00
go.sum go mod vendor 2018-11-20 12:09:59 -08:00
scalar.go vendor: update go-scalar to the latest version 2018-11-20 12:18:45 +03:00

README.md

GoDoc Build Status Coverage Status Report Card

Scalar parsing library

Scalar is a library for parsing strings into arbitrary scalars (integers, floats, strings, booleans, etc). It is helpful for tasks such as parsing strings passed as environment variables or command line arguments.

go get github.com/alexflint/go-scalar

The main API works as follows:

var value int
err := scalar.Parse(&value, "123")

There is also a variant that takes a reflect.Value:

var value int
err := scalar.ParseValue(reflect.ValueOf(&value), "123")