--- /dev/null
+# For reproducibility and easier cross-compilation,
+# nothing in std is supposed to use cgo on macOS.
+# Check that cgo does not appear as a dependency
+# of cmd/go, which imports approximately everything
+# in std (certainly everything relevant).
+[!GOOS:darwin] skip
+go list -deps cmd/go
+! stdout runtime/cgo
+
internal/coverage, crypto/sha256, FMT
< cmd/internal/cov/covcmd;
- encoding/json,
+ encoding/json,
runtime/debug,
internal/coverage/calloc,
internal/coverage/cformat,
internal/coverage/encodecounter, internal/coverage/encodemeta,
internal/coverage/pods
< runtime/coverage;
+
+ # Test-only packages can have anything they want
+ CGO, internal/syscall/unix < net/internal/cgotest;
+
+
`
// listStdPkgs returns the same list of packages as "go list std".
--- /dev/null
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cgotest
+
+import "testing"
+
+// Nothing to test here.
+// The test is that the package compiles at all.
+// See resstate.go.
+func Test(t *testing.T) {
+}
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build !netgo && cgo && darwin
+//go:build cgo && darwin
-package net
+package cgotest
/*
#include <resolv.h>