github.com/code-reading/golang@v0.0.0-20220303082512-ba5bc0e589a3/go/src/net/internal/socktest/main_unix_test.go (about) 1 // Copyright 2015 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build !js && !plan9 && !windows 6 // +build !js,!plan9,!windows 7 8 package socktest_test 9 10 import "syscall" 11 12 var ( 13 socketFunc func(int, int, int) (int, error) 14 closeFunc func(int) error 15 ) 16 17 func installTestHooks() { 18 socketFunc = sw.Socket 19 closeFunc = sw.Close 20 } 21 22 func uninstallTestHooks() { 23 socketFunc = syscall.Socket 24 closeFunc = syscall.Close 25 }