Go to file
Alex Flint 8ca9e7daec improve test coverage 2021-08-20 20:18:30 -07:00
.github/workflows add a github workflow to run tests 2021-04-19 21:50:34 -07:00
.gitignore add misc support files 2017-02-15 17:52:23 -08:00
LICENSE add misc support files 2017-02-15 17:52:23 -08:00
README.md add readme 2017-02-15 17:49:27 -08:00
go.mod update go.mod 2021-04-19 21:45:25 -07:00
go.sum add initial go.mod, go.sum 2018-11-19 19:04:03 -08:00
scalar.go add support for url.URL 2021-08-17 12:24:43 -07:00
scalar_test.go improve test coverage 2021-08-20 20:18:30 -07: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")