Skip to content

PaulXu-cn/goeval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Evaluate Golang Code by the Eval Function

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages