go-hesabu
go-hesabu is golang equivalent to hesabu
Usage
Taking equations
{
"c": "a + 10 * b",
"b": "10+a",
"a": "10"
}
logs the solution
go run hesabu.go ./test/small.json
or via the piped version
cat ./test/small.json | go run hesabu.go
you will get
{
"a": 10,
"b": 20,
"c": 210,
}
Development
Development setup
require a go 1.9 and dep
mkdir -p $GOPATH/src/github.com/BLSQ
cd $GOPATH/src/github.com/BLSQ
git clone git@github.com:BLSQ/go-hesabu.git
cd go-hesabu
dep ensure
go test github.com/BLSQ/go-hesabu/hesabu -coverprofile=coverage.out
go tool cover -html=coverage.out
go run hesabu.go ./test/small.json
For more info see workspace structure in https://golang.org/doc/code.html
build the cli
go build -ldflags="-s -w" -o hesabucli hesabu.go; mv hesabucli ../hesabu/bin
for mac
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o hesabucli hesabu.go
Dependencies
relies on
License
The code is available as open source under the terms of the MIT License.