gopls/internal/regtest/diagnostics: require cgo for TestGoListErrors

Fixes golang/go#58103

Change-Id: I378496e5ed791e33932c58d88cfb1f37ff125936
Reviewed-on: https://go-review.googlesource.com/c/tools/+/463686
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/gopls/internal/regtest/diagnostics/golist_test.go b/gopls/internal/regtest/diagnostics/golist_test.go
index ec54a92..85b35be 100644
--- a/gopls/internal/regtest/diagnostics/golist_test.go
+++ b/gopls/internal/regtest/diagnostics/golist_test.go
@@ -9,9 +9,12 @@
 
 	. "golang.org/x/tools/gopls/internal/lsp/regtest"
 	"golang.org/x/tools/gopls/internal/lsp/source"
+	"golang.org/x/tools/internal/testenv"
 )
 
 func TestGoListErrors(t *testing.T) {
+	testenv.NeedsTool(t, "cgo")
+
 	const src = `
 -- go.mod --
 module a.com