1 // Copyright 2017 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.
13 skipStdinCopyError
= func(err error
) bool {
14 // Ignore ERROR_BROKEN_PIPE and ERROR_NO_DATA errors copying
15 // to stdin if the program completed successfully otherwise.
17 const _ERROR_NO_DATA
= syscall
.Errno(0xe8)
18 pe
, ok
:= err
.(*os
.PathError
)
20 pe
.Op
== "write" && pe
.Path
== "|1" &&
21 (pe
.Err
== syscall
.ERROR_BROKEN_PIPE || pe
.Err
== _ERROR_NO_DATA
)