Source file src/cmd/go/stop_other_test.go
Documentation: cmd/go
1 // Copyright 2021 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 !(aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris) 6 // +build !aix 7 // +build !darwin 8 // +build !dragonfly 9 // +build !freebsd 10 // +build !js !wasm 11 // +build !linux 12 // +build !netbsd 13 // +build !openbsd 14 // +build !solaris 15 16 package main_test 17 18 import ( 19 "os" 20 "runtime" 21 ) 22 23 // quitSignal returns the appropriate signal to use to request that a process 24 // quit execution. 25 func quitSignal() os.Signal { 26 if runtime.GOOS == "windows" { 27 // Per https://golang.org/pkg/os/#Signal, “Interrupt is not implemented on 28 // Windows; using it with os.Process.Signal will return an error.” 29 // Fall back to Kill instead. 30 return os.Kill 31 } 32 return os.Interrupt 33 } 34