summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlex Flint <[email protected]>2017-02-15 17:49:27 -0800
committerAlex Flint <[email protected]>2017-02-15 17:49:27 -0800
commite2bdcd773ee8c35601fbdecb1e4b62c3979c1244 (patch)
treef76d1d3a57cdd188268c1f7cfa5bacfc04398bbe /README.md
parent679dadd066b3a2df0ea42cdc0975937086cc522c (diff)
add readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e6f510e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+[![GoDoc](https://godoc.org/github.com/alexflint/go-scalar?status.svg)](https://godoc.org/github.com/alexflint/go-scalar)
+[![Build Status](https://travis-ci.org/alexflint/go-scalar.svg?branch=master)](https://travis-ci.org/alexflint/go-scalar)
+[![Coverage Status](https://coveralls.io/repos/alexflint/go-scalar/badge.svg?branch=master&service=github)](https://coveralls.io/github/alexflint/go-scalar?branch=master)
+[![Report Card](https://goreportcard.com/badge/github.com/alexflint/go-scalar)](https://goreportcard.com/badge/github.com/alexflint/go-scalar)
+
+## 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.
+
+```shell
+go get github.com/alexflint/go-scalar
+```
+
+The main API works as follows:
+
+```go
+var value int
+err := scalar.Parse(&value, "123")
+```
+
+There is also a variant that takes a `reflect.Value`:
+
+```go
+var value int
+err := scalar.ParseValue(reflect.ValueOf(&value), "123")
+```