Skip to content
Snippets Groups Projects
Select Git revision
  • 930b078129316067c5791aaa49d6fb627a0ac51b
  • main default protected
  • feature/finalizing_v2
  • ui-experiment
  • feature/finalizing
  • dev
  • feedback_errors_to_llama
  • automatic_prompt
  • timetracking
  • database
  • experiment/api-running-ollama
11 results

go_compiler.go

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    go_compiler.go 575 B
    package go_compiler
    
    import (
    	"compiler"
    	"runtime"
    )
    
    // Deprecated: Use `go_compiler_v2.NewGoCompiler` instead
    //
    // CompileStringToGo tries to compile a string of go code to a go executable, and returns the compiler output and an error.
    // The function does not produce any executables, since they are deleted after the function ends.
    func CompileStringToGo(code string, filename string, _ ...string) (string, error) {
    
    	// Get the platform
    	OS := runtime.GOOS
    
    	// SetupEnvironment
    	return compiler.InitCompiler(compiler.OS(OS), compiler.Go, code, filename).Compile()
    }