Skip to content

tekintian/goeval

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goeval

Evaluate Golang Code by the Eval Function

Install

$ go get github.com/tekintian/goeval

Usage

package main

import (
    "fmt"
    "github.com/tekintian/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 and block all unsafe opperation

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%