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: go get: is there any way that 'go get' can retrieve packages which have no buildable go source files #14764

Closed
awkr opened this issue Mar 11, 2016 · 5 comments
Milestone

Comments

@awkr
Copy link

awkr commented Mar 11, 2016

Please answer these questions before submitting your issue. Thanks!

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

go1.6 darwin/amd64

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

darwin/amd64

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.

i have a package that it can generate some go source files using txt/template. Without initial makefile, it can't build at all which i intend to that.

  1. What did you expect to see?

it's just download package itself, without compile or build

  1. What did you see instead?

package XXX: no buildable Go source files in ...

ps: go get -d also fails ...

@awkr awkr changed the title is there any way that 'go get' can retrieve packages which have no buildable go source files go get: is there any way that 'go get' can retrieve packages which have no buildable go source files Mar 11, 2016
@ianlancetaylor
Copy link
Contributor

If the package has no Go files, then you can't import it, so you have to use go get -d. You say that go get -d fails; how does it fail?

@ianlancetaylor ianlancetaylor changed the title go get: is there any way that 'go get' can retrieve packages which have no buildable go source files cmd/go: go get: is there any way that 'go get' can retrieve packages which have no buildable go source files Mar 11, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Mar 11, 2016
@minux
Copy link
Member

minux commented Mar 11, 2016 via email

@awkr
Copy link
Author

awkr commented Mar 11, 2016

@ianlancetaylor @minux

thanks~

my scenario is using Makefile to build/deploy go projects.
the Makefile file contents may looks like:

init:
    go get -u github.com/xx/yy
    go get github.com/aa/bb

if i want to build the project, i can simply type "make init". BUT, if the command "go get github.com/aa/bb" fails, it will break the process of making. although i can use "make -i init", but as a programmer, it feels uncomfortable to see any exceptions.😂

i want to know or as a suggestion, if go can provide any callbacks of cmd/go tools, so we can register some events to do specified functions

@davecheney
Copy link
Contributor

go get is just a wrapper around git clone, why not call git clone explicity
?

On Fri, Mar 11, 2016 at 3:18 PM, Hongjian Zhu notifications@github.com
wrote:

@ianlancetaylor https://github.com/ianlancetaylor @minux
https://github.com/minux

thanks~

my scenario is using Makefile to build/deploy go projects.
the Makefile file contents may looks like:

init:
go get -u github.com/xx/yy
go get github.com/aa/bb

if i want to build the project, i can simply type "make init". BUT, if the
command "go get github.com/aa/bb" fails, it will break the process of
making. although i can use "make -i init", but as a programmer, it feels
uncomfortable to see any exceptions.😂

i want to know or as a suggestion, if go can provide any callbacks of
cmd/go tools, so we can register some events to do specified functions


Reply to this email directly or view it on GitHub
#14764 (comment).

@rsc
Copy link
Contributor

rsc commented May 17, 2016

That's really not what go get is for. Probably git clone is your best bet.

@rsc rsc closed this as completed May 17, 2016
@golang golang locked and limited conversation to collaborators May 17, 2017
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

6 participants