From b1335037fad4c81ce296f652372aa631a29dcb48 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 7 Mar 2018 23:03:24 +0100 Subject: [PATCH] cmd/go: skip TestVetWithOnlyCgoFiles when cgo is disabled CL 99175 added TestVetWithOnlyCgoFiles. However, this test is failing on platforms where cgo is disabled, because no file can be built. This change fixes TestVetWithOnlyCgoFiles by skipping this test when cgo is disabled. Fixes #24304. Change-Id: Ibb38fcd3e0ed1a791782145d3f2866f12117c6fe Reviewed-on: https://go-review.googlesource.com/99275 Reviewed-by: Brad Fitzpatrick --- src/cmd/go/go_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 0e44004cb1..d66ac20aa4 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -3235,6 +3235,10 @@ func TestGoVetWithOnlyTestFiles(t *testing.T) { // Issue 24193. func TestVetWithOnlyCgoFiles(t *testing.T) { + if !canCgo { + t.Skip("skipping because cgo not enabled") + } + tg := testgo(t) defer tg.cleanup() tg.parallel() -- 2.48.1