Skip to content

cmd/go: GOPROXY using file:// protocol not working on Windows #27698

@chowey

Description

@chowey

Please answer these questions before submitting your issue. Thanks!

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

go version go1.11 windows/386

Does this issue reproduce with the latest release?

Yes.

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

GOARCH=386
GOOS=windows

What did you do?

git clone https://github.com/pkg/errors c:/repos/github.com/pkg/errors
set GOPROXY=file:///c:/repos
echo package main;import _ "github.com/pkg/errors";func main(){}> main.go
go mod init test
go run .

What did you expect to see?

Successfully imported the package and ran the program. This is documented in cmd/go, where it says:

A Go module proxy is any web server that can respond to GET requests for URLs of a specified form. The requests have no query parameters, so even a site serving from a fixed file system (including a file:/// URL) can be a module proxy.

Also from the module wiki:

Run go help goproxy for more about the module proxy, including a pure file-based option via a file:/// URL.

What did you see instead?

build test: cannot find module for path github.com/pkg/errors

I may be doing something wrong, but the documentation seems to indicate file:/// is supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions