Go to file
Jeff Carr 6080327a64 bare minimum
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-14 14:14:07 -06:00
.github/workflows update to latest version of the setup-go github action 2022-10-02 12:50:21 -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
Makefile bare minimum 2024-01-14 14:14:07 -06:00
README.md add readme 2017-02-15 17:49:27 -08:00
go.mod bare minimum 2024-01-14 14:14:07 -06:00
scalar.go Support different integer formats 2022-10-02 19:11:37 +02: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")