Skip to content

go/build: should package be aware of GOBIN? #4891

@GeertJohan

Description

@GeertJohan
When using build.Import("GOPATH/src/myCmd", "", 0) a *Package is
returned that has the field BinDir set to be GOPATH/bin. 
Package.BinDir is documented as "command install directory".
However: cmd/go states "If the GOBIN environment variable is set, commands are
installed to the directory it names instead of DIR/bin."
(http://golang.org/cmd/go/#hdr-GOPATH_environment_variable)

Is it up to pkg/go/build to check for the existence of GOBIN? Or should a user
implementation check for GOBIN?

Example of a fix:
GeertJohan/rerun@b3bf4d7

pkg/go/build source code concerning the *Package BinDir field:
http://code.google.com/p/go/source/browse/src/pkg/go/build/build.go#521

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.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions