]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/vet: basic tests of go vet -json -c=N flags
authorAlan Donovan <adonovan@google.com>
Fri, 16 Nov 2018 19:43:23 +0000 (14:43 -0500)
committerAlan Donovan <adonovan@google.com>
Fri, 16 Nov 2018 21:05:53 +0000 (21:05 +0000)
Change-Id: I787592a5d92ff9329ecdfcf879e491af66c8b749
Reviewed-on: https://go-review.googlesource.com/c/149962
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/testdata/script/vet_asm.txt

index b7e1874b8cb0dd9fc9e57d6fb1094606a73ed2fa..807e2b76f589999f9670fe30464b9dd31d44f570 100644 (file)
@@ -5,6 +5,21 @@ env GOARCH=amd64
 ! go vet -asmdecl a
 stderr 'f: invalid MOVW of x'
 
+# -c flag shows context
+! go vet -c=2 -asmdecl a
+stderr '...invalid MOVW...'
+stderr '1      .*TEXT'
+stderr '2              MOVW'
+stderr '3              RET'
+stderr '4'
+
+# -json causes success, even with diagnostics and errors.
+go vet -json -asmdecl a
+stderr '"a": {'
+stderr   '"asmdecl":'
+stderr     '"posn": ".*asm.s:2:1",'
+stderr     '"message": ".*invalid MOVW.*"'
+
 -- a/a.go --
 package a