main
                  
                  
                  
                  
                  
                  var source = `
                  
                  
                  package main
                  
                  
                  
                  
                  
                  import "fmt"
                  
                  
                  
                  
                  
                  func main() {
                  
                  
                   fmt.Println("Hello, Go!")
                  
                  
                  }
                  
                  
                  `
                  
                  
                  
                  
                  
                  func main() {
                  
                  
                   bin := somePackage.Build(source)
                  
                  
                  
                  
                  
                  
                  
                  
                   f, err := os.Create("bin")
                  
                  
                   ... // some code
                  
                  
                   file.Write(bin)
                  
                  
                  
                  
                  
                   out, err := exec.Command("bin").Output()
                  
                  
                   ... // some code 
                  
                  
                  
                  
                  
                   fmt.Printf("Go in go: (%s!)\n", out) // Go in go: (Hello, Go!)
                  
                  
                  }
                  
                  
                
есть пэкэдж gc, но он internal
Обсуждают сегодня