Skip to content
Snippets Groups Projects
main.go 521 B
Newer Older
  • Learn to ignore specific revisions
  • package main
    
    
    import (
    	"fmt"
    	"io/ioutil"
    	"path/filepath"
    	"strings"
    )
    
    
    func main() {
    
    	result := GetClientJsLibrary("https://test.org")
    	fmt.Println("Hello, world.")
    	fmt.Println(result)
    
    func GetClientJsLibrary(iframeUrl string) string {
    	path, err := filepath.Abs("../vcl/javascript/dist/viamapi-client.js")
    
    	if err != nil {
    		fmt.Println(err.Error())
    	}
    
    	dat, err := ioutil.ReadFile(path)
    
    	if err != nil {
    		fmt.Println(err.Error())
    	}
    
    	return strings.Replace(string(dat), "{{urlArg}}", iframeUrl, 1) + "\n"