Skip to content

x/sys/windows: go test ./... failed on windows #35246

@caixw

Description

@caixw

What version of Go are you using (go version)?

$ go version
go version go1.12 windows/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\xx\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\xx\go
set GOPROXY=https://goproxy.io
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map==C:\Users\ xx\AppData\Local\Temp\go-build199807830=/tmp/go-build -gno-record-gcc-switches

What did you do?

file.go

import "golang.org/x/sys/windows"

func Foo(v ...interface{}) (err error) {
	var info windows.ConsoleScreenBufferInfo
	return windows.GetConsoleScreenBufferInfo(windows.Stdout, &info)
}

file_test.go

import "testing"

func TestFoo(t *testing.T) {
	if err := Foo("test"); err != nil {
		t.Error(err)
	}
}

go test:

PASS
ok      github.com/issue9/term  0.386s

go test ./... or go test .:

--- FAIL: TestFoo (0.00s)
    file_test.go:11: The handle is invalid.
FAIL
FAIL    github.com/issue9/term  0.380s

What did you expect to see?

What did you see instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Windowscompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    Triage Backlog

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions