Evaluate formula in Go

前端 未结 8 988
梦如初夏
梦如初夏 2021-01-02 12:46

Using Go (golang) I\'d like to take a string with a formula and evaluate it with pre-defined values. Here\'s a way to do it with python\'s parser module:

<
8条回答
  •  [愿得一人]
    2021-01-02 13:07

    Googling around I found this: https://github.com/sbinet/go-eval

    It appears to be an eval loop for Go.

    go get github.com/sbinet/go-eval/cmd/go-eval
    go install github.com/sbinet/go-eval/cmd/go-eval
    go-eval
    

提交回复
热议问题