Skip to content

cmd/go: go test doesn't like long paths on Windows #10651

@anforowicz

Description

@anforowicz

Expected behavior: go test works

Actual behavior: go test fails because it trips over long paths it itself constructs for building and running the tests

Output of "go version":
go version go1.4.2 windows/amd64

Repro steps:

C:\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather\like\and\enjoy>type foo\foo.go

package foo

func Foo() string {
return "foo"
}

C:\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather\like\and\enjoy>type foo\foo_test.go

package foo

import "testing"

func TestFoo(t *testing.T) {
t.Log("Testing foo")
}

C:\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather\like\and\enjoy>go test .\foo

/C/Users/lukasza/my/enlistment/has/rather/long/and/descriptive/paths/that/I/rather/like/and/enjoy/foo

mkdir C:\Users\lukasza\AppData\Local\Temp\go-build344025871_\C_\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather\like\and\enjoy
foo_test_\C_\Users\lukasza\my\enlistment\has\rather\long\and\descriptive\paths\that\I\rather: The filename or extension is too long.
FAIL /C/Users/lukasza/my/enlistment/has/rather/long/and/descriptive/paths/that/I/rather/like/and/enjoy/foo [setup failed]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions