mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
main: change -json flag to match upstream Go
This changes the -json flag for build/run/flash/gdb etc commands to not print `compileopts.Config` but instead match upstream Go and print build errors in a structured way. For more details, see the proposal: https://github.com/golang/go/issues/62067
This commit is contained in:
committed by
Ron Evans
parent
aa63f26f36
commit
c2765e9eca
+6
-1
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/tinygo-org/tinygo/builder"
|
||||
"github.com/tinygo-org/tinygo/compileopts"
|
||||
"github.com/tinygo-org/tinygo/diagnostics"
|
||||
)
|
||||
@@ -64,7 +65,11 @@ func testErrorMessages(t *testing.T, filename string, options *compileopts.Optio
|
||||
|
||||
// Try to build a binary (this should fail with an error).
|
||||
tmpdir := t.TempDir()
|
||||
err := Build(filename, tmpdir+"/out", options)
|
||||
config, err := builder.NewConfig(options)
|
||||
if err != nil {
|
||||
t.Fatal("expected to get a compiler error")
|
||||
}
|
||||
err = Build(filename, tmpdir+"/out", config)
|
||||
if err == nil {
|
||||
t.Fatal("expected to get a compiler error")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user