question about src/cmd/go/internal/script/cmds_posix.go and windows

88 views
Skip to first unread message

hnak...@gmail.com

unread,
May 13, 2024, 4:32:38 AM5/13/24
to golang-nuts
Hi,
I found that
https://github.com/golang/go/blob/07fc59199b9522bfe0d14f35c4391394efc336c9/src/cmd/go/internal/script/cmds_posix.go
has the build tag
//go:build unix || windows

Is windows really needed here? (I suppose not)

isETXTBSY is also defined in
https://github.com/golang/go/blob/07fc59199b9522bfe0d14f35c4391394efc336c9/src/cmd/go/internal/test/test_unix.go
and its build tag is:
//go:build unix
which I think correct.

Thanks,
Hiroaki

peterGo

unread,
May 13, 2024, 6:27:19 AM5/13/24
to golang-nuts
Hiroaki,

go/src/syscall/zerrors_windows.go

// Invented values to support what package os and others expects.
const (
...
ETXTBSY
...
)

peter

peterGo

unread,
May 13, 2024, 7:08:18 AM5/13/24
to golang-nuts
Hiroaki,

go/src/cmd/go/internal/test/test_nonunix.go

//go:build !unix

package test

func isETXTBSY(err error) bool {
// syscall.ETXTBSY is only meaningful on Unix platforms.
return false
}

peter

On Monday, May 13, 2024 at 4:32:38 AM UTC-4 hnak...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages