From a3f64237adf0ccfe379ffa2cb00e013896995a3a Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 16 Nov 2018 14:43:23 -0500 Subject: [PATCH] cmd/vet: basic tests of go vet -json -c=N flags Change-Id: I787592a5d92ff9329ecdfcf879e491af66c8b749 Reviewed-on: https://go-review.googlesource.com/c/149962 Run-TryBot: Alan Donovan Reviewed-by: Michael Matloob TryBot-Result: Gobot Gobot --- src/cmd/go/testdata/script/vet_asm.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/cmd/go/testdata/script/vet_asm.txt b/src/cmd/go/testdata/script/vet_asm.txt index b7e1874b8c..807e2b76f5 100644 --- a/src/cmd/go/testdata/script/vet_asm.txt +++ b/src/cmd/go/testdata/script/vet_asm.txt @@ -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 -- 2.50.0