mirror of
https://github.com/golang/go.git
synced 2025-05-18 22:04:38 +00:00
net: move cgo-using darwin test to separate package
It is a goal / requirement that nothing in the standard library on darwin require cgo, and this test-only file makes net use cgo on darwin. Move it elsewhere. Change-Id: I6c11a8391d3913f73ce0098ba63b29adf5864f93 Reviewed-on: https://go-review.googlesource.com/c/go/+/549255 Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
76b8bec6db
commit
4085a4893c
9
src/cmd/go/testdata/script/darwin_no_cgo.txt
vendored
Normal file
9
src/cmd/go/testdata/script/darwin_no_cgo.txt
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
# 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
|
||||
|
@ -680,6 +680,11 @@ var depsRules = `
|
||||
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".
|
||||
|
13
src/net/internal/cgotest/empty_test.go
Normal file
13
src/net/internal/cgotest/empty_test.go
Normal file
@ -0,0 +1,13 @@
|
||||
// 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) {
|
||||
}
|
@ -2,9 +2,9 @@
|
||||
// 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>
|
Loading…
x
Reference in New Issue
Block a user