basic generation
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
commit
8402d724a9
4 changed files with 52 additions and 0 deletions
30
gen.go
Normal file
30
gen.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
var flOutput = flag.String("o", "", "output file to write")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
err := ioutil.WriteFile(*flOutput, []byte(source), os.FileMode(0644))
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
var source = `
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func foo() {
|
||||
fmt.Println("brrnnt")
|
||||
}
|
||||
`
|
Loading…
Add table
Add a link
Reference in a new issue