Unverified Commit 07d051e5 authored by Rod Vagg's avatar Rod Vagg

betterer codegen invocation

parent 035ab815
// +build ignore
package main
// based on https://github.com/ipld/go-ipld-prime-proto/blob/master/gen/main.go
import (
"os/exec"
"fmt"
"os"
"github.com/ipld/go-ipld-prime/schema"
gengo "github.com/ipld/go-ipld-prime/schema/gen/go"
)
func main() {
ts := schema.TypeSystem{}
ts.Init()
adjCfg := &gengo.AdjunctCfg{}
......@@ -55,8 +57,12 @@ func main() {
schema.SpawnStructRepresentationMap(nil),
))
// note in scope: ts.Accumulate(schema.SpawnBytes("RawNode"))
if errs := ts.ValidateGraph(); errs != nil {
for _, err := range errs {
fmt.Printf("- %s\n", err)
}
os.Exit(1)
}
gengo.Generate("./", pkgName, ts, adjCfg)
exec.Command("go", "fmt").Run()
gengo.Generate(".", pkgName, ts, adjCfg)
}
......@@ -31,7 +31,6 @@ const (
laState_midValue
laState_finished
)
type _ErrorThunkAssembler struct {
e error
}
......
This diff is collapsed.
......@@ -5,7 +5,6 @@ package dagpb
import (
ipld "github.com/ipld/go-ipld-prime"
)
var _ ipld.Node = nil // suppress errors when this dependency is not referenced
// Type is a struct embeding a NodePrototype/Type for every Node implementation in this package.
// One of its major uses is to start the construction of a value.
......@@ -74,3 +73,4 @@ type _PBNode struct {
// String matches the IPLD Schema type "String". It has string kind.
type String = *_String
type _String struct{ x string }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment