From 8e1f12f001be4eefebb2930dd9f647a1a0a837ed 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] [release-branch.go1.10] 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 (cherry picked from commit b1335037fad4c81ce296f652372aa631a29dcb48) Reviewed-on: https://go-review.googlesource.com/103223 Reviewed-by: David du Colombier <0intro@gmail.com> Reviewed-by: Ian Lance Taylor Run-TryBot: Andrew Bonventre TryBot-Result: Gobot Gobot --- 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 a985f2afef..7e6b492db4 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