github.com/simonferquel/app@v0.6.1-0.20181012141724-68b7cccf26ac/pkg/yatee/gopher/main.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/docker/app/pkg/yatee"
     5  	"github.com/gopherjs/gopherjs/js"
     6  )
     7  
     8  func processJS(input, settings string) (string, string) {
     9  	res, err := yatee.ProcessStrings(input, settings)
    10  	var errStr string
    11  	if err != nil {
    12  		errStr = err.Error()
    13  	}
    14  	return res, errStr
    15  }
    16  
    17  func main() {
    18  	js.Global.Set("yatee", map[string]interface{}{
    19  		"ProcessJS": processJS,
    20  	})
    21  }