Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 440 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 440 Bytes

goeval

Evaluate Golang Code by the Eval Function

Install

$ go get github.com/PaulXu-cn/goeval

Usage

package main

import (
    "fmt"
    "github.com/PaulXu-cn/goeval"
)

func main() {
    if re, err := goeval.Eval("", "fmt.Print(\"Hello World!\")", "fmt"); nil == err {
        fmt.Println(string(re))
    } else {
        fmt.Println(err.Error())
    }
}
Hello World!

It's simple! Try it.