ob-go
ob-go copied to clipboard
feature request: support import's in source with main() auto-wrapping enabled
It will be handy if ob-go detected import statements and put them at the beginning of the generated file, without needing to explicitly declare a main() function, so:
import "fmt"
fmt.Println(1)
will be internally translated to:
package main
import "fmt"
func main() {
fmt.Println(1)
}
Currently this block is translated to invalid go and the compilation fails:
package main
func main() {
import "fmt"
fmt.Println(1)
}