-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up node/gendemo; generation now has standard triggers.
Do regeneratation. Some diff churn: the codegen doesn't yet jive smoothly with a recent change made in service to go vet. We'll want to straighten that out soon, I guess.
- Loading branch information
Showing
5 changed files
with
111 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// +build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/ipld/go-ipld-prime/schema" | ||
gengo "github.com/ipld/go-ipld-prime/schema/gen/go" | ||
) | ||
|
||
func main() { | ||
pkgName := "gendemo" | ||
ts := schema.TypeSystem{} | ||
ts.Init() | ||
adjCfg := &gengo.AdjunctCfg{} | ||
ts.Accumulate(schema.SpawnInt("Int")) | ||
ts.Accumulate(schema.SpawnString("String")) | ||
ts.Accumulate(schema.SpawnStruct("Msg3", | ||
[]schema.StructField{ | ||
schema.SpawnStructField("whee", "Int", false, false), | ||
schema.SpawnStructField("woot", "Int", false, false), | ||
schema.SpawnStructField("waga", "Int", false, false), | ||
}, | ||
schema.SpawnStructRepresentationMap(nil), | ||
)) | ||
ts.Accumulate(schema.SpawnMap("Map__String__Msg3", | ||
"String", "Msg3", false)) | ||
gengo.Generate(".", pkgName, ts, adjCfg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//go:generate go run gen.go | ||
//go:generate gofmt -w . | ||
|
||
package gendemo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.