feat: initial commit
This commit is contained in:
commit
a161b86c9a
705 changed files with 288162 additions and 0 deletions
28
vendor/github.com/alexflint/go-scalar/README.md
generated
vendored
Normal file
28
vendor/github.com/alexflint/go-scalar/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
[](https://godoc.org/github.com/alexflint/go-scalar)
|
||||
[](https://travis-ci.org/alexflint/go-scalar)
|
||||
[](https://coveralls.io/github/alexflint/go-scalar?branch=master)
|
||||
[](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")
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue