Skip to content

Commit

Permalink
generate-gnostic: fix dropped errors (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
alrs authored Dec 20, 2023
1 parent da1adca commit f702249
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generate-gnostic/generate-extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ func generateExtension(schemaFile string, outDir string) error {
return err
}
err = exec.Command(runtime.GOROOT()+"/bin/gofmt", "-w", goFilename).Run()
if err != nil {
return err
}

// generate the main file.

Expand Down
6 changes: 6 additions & 0 deletions generate-gnostic/generate-extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ func TestErrorExtensionGeneratorUnsupportedPrimitive(t *testing.T) {
"test/x-unsupportedprimitives.json",
"--out_dir=/tmp",
).Output()
if err != nil {
t.Fatalf("error executing generate-gnostic: %v", err)
}

outputFile := "x-unsupportedprimitives.errors"
_ = ioutil.WriteFile(outputFile, output, 0644)
Expand All @@ -38,6 +41,9 @@ func TestErrorExtensionGeneratorNameCollision(t *testing.T) {
"test/x-extension-name-collision.json",
"--out_dir=/tmp",
).Output()
if err != nil {
t.Fatalf("error executing generate-gnostic: %v", err)
}

outputFile := "x-extension-name-collision.errors"
_ = ioutil.WriteFile(outputFile, output, 0644)
Expand Down

0 comments on commit f702249

Please sign in to comment.