Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: emit better error message on improper use go "go install" #6191

Closed
gopherbot opened this issue Aug 20, 2013 · 4 comments
Closed

cmd/go: emit better error message on improper use go "go install" #6191

gopherbot opened this issue Aug 20, 2013 · 4 comments
Milestone

Comments

@gopherbot
Copy link

by dean.w.schulze:

go version go1.1.2 windows/amd64
(Also happens in go version go1.1 windows/amd64)

GOPATH (Cygwin):
c:\dean\golang\go3p:c:\dean\courses\algorithms-stanford\design.and.analysis.of.algorithms.1\programming-questions\common\code\golang

The file algoutils.go is in the directory 

c:\dean\courses\algorithms-stanford\design.and.analysis.of.algorithms.1\programming-questions\common\code\golang\src\algoutils

From that directory run

    go install algoutils.go

go install: no install location for directory
C:\dean\courses\algorithms-stanford\design.and.analysis.of.algorithms.1\programming-questions\common\code\golang\src\algoutils
outside GOPATH

I get the same error if I run from Cygwin or if I run from DOS.  The DOS GOPATH is

GOPATH=c:\dean\golang\go3p;c:\dean\courses\algorithms-stanford\design.and.analysis.of.algorithms.1\programming-questions\common\code\golang

In both cases (DOS and Cygwin) the command "go install algoutils" works.  It's
just an issue of the algoutils.go file is given as the input.
@gopherbot
Copy link
Author

Comment 1 by dean.w.schulze:

Slight correction.  The GOPATH in Cygwin was
c:\dean\courses\algorithms-stanford\design.and.analysis.of.algorithms.1\programming-questions\common\code\golang
Only one directory in the GOPATH.
When creating the GOPATH in .bashrc for Cygwin the directories have to be separated by a
semi-colon not a colon since the DOS conventions have to be followed.
This doesn't change the issue with using a .go file as the argument to "go install".

@adg
Copy link
Contributor

adg commented Aug 20, 2013

Comment 2:

The issue is a bad error message. "go install" takes a package path as its argument, not
.go source files. The entire concept of installation is tied to package paths.

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@robpike
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 3:

"go install file.go" works just fine if GOBIN is set. I will file a separate issue for
that.

@rsc
Copy link
Contributor

rsc commented Sep 10, 2013

Comment 4:

This issue was closed by revision 159c2b7.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants