this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

small tweaks

+7 -3
+6 -2
cmd/lexgen/generate.go
··· 40 40 if gen.Config.WarningText != "" { 41 41 fmt.Fprintf(gen.Out, "// %s\n\n", gen.Config.WarningText) 42 42 } 43 + fmt.Fprintf(gen.Out, "// Lexicon schema: %s\n\n", gen.Lex.NSID) 43 44 fmt.Fprintf(gen.Out, "package %s\n\n", gen.pkgName()) 44 - fmt.Fprintf(gen.Out, "// schema: %s\n\n", gen.Lex.NSID) 45 45 fmt.Fprintln(gen.Out, "import (") 46 46 for dep, _ := range gen.deps() { 47 47 fmt.Fprintf(gen.Out, " %s\n", dep) ··· 323 323 324 324 // if this is a def-level struct, write out type decoder 325 325 if len(ft.Path) == 0 { 326 - fmt.Fprintf(gen.Out, " LexiconTypeID string `json:\"$type\" cborgen:\"$type\"`\n") 326 + fullName := gen.Lex.NSID.String() 327 + if ft.DefName != "main" { 328 + fullName += "#" + ft.DefName 329 + } 330 + fmt.Fprintf(gen.Out, " LexiconTypeID string `json:\"$type\" cborgen:\"$type,const=%s\"`\n", fullName) 327 331 } 328 332 329 333 for _, fname := range fieldNames {
+1 -1
cmd/lexgen/main.go
··· 56 56 }, 57 57 &cli.StringFlag{ 58 58 Name: "output-dir", 59 - Value: "./lexgen-out/", 59 + Value: "./lexgen-output/", 60 60 Usage: "base directory for output packages", 61 61 Sources: cli.EnvVars("OUTPUT_DIR"), 62 62 },