diff --git a/gen/gen.go b/gen/gen.go index ee7c740c..99e6d917 100644 --- a/gen/gen.go +++ b/gen/gen.go @@ -1,6 +1,8 @@ package main import ( + "os" + "github.com/filecoin-project/go-state-types/builtin" gen "github.com/whyrusleeping/cbor-gen" @@ -22,4 +24,15 @@ func main() { ); err != nil { panic(err) } + + // now append the string "'// helloworld" to the builtin/cbor_gen.go file: + // use regular go api to open the file and write to it: + f, err := os.OpenFile("./builtin/cbor_gen.go", os.O_APPEND|os.O_WRONLY, 0644) + if err != nil { + panic(err) + } + defer f.Close() + if _, err := f.WriteString("\n// helloworld\n"); err != nil { + panic(err) + } }