/usr/local/Cellar/go/1.6/libexec/pkg/tool/darwin_amd64/link: cannot open file /usr/local/Cellar/go/1.6/libexec/pkg/darwin_amd64/gopkg.in/yaml.v2.a: open /usr/local/Cellar/go/1.6/libexec/pkg/darwin_amd64/gopkg.in/yaml.v2.a: no such file or directory/usr/local/go/pkg/tool/linux_amd64/link: cannot open file /usr/local/go/pkg/linux_amd64/github.com/conslo/badlink.a: open /usr/local/go/pkg/linux_amd64/github.com/conslo/badlink.a: no such file or directory~ ❯❯❯ find $GOPATH -name 'badlink.a'/Users/xxx/gowork/pkg/darwin_amd64/github.com/conslo/badlink.a~ ❯❯❯--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/OAQzIysNSuU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
With homebrew /usr/local/* is writeable (homebrew doesn't run as root) could that be causing the problem?
Also docker runs as root in containers by default, so that makes sense. I've reinstalled go a few times already via homebrew but if it simply "being writable by the current user" causes the problem...
On Saturday, 5 March 2016 14:42:04 UTC+11, Travis Johnson wrote:With homebrew /usr/local/* is writeable (homebrew doesn't run as root) could that be causing the problem?Probably not, but that's gross on the part of homebrew.
It's not so much about "who is root", but simple insurance, you're code goes in your $HOME, owned by you, writable by you. Stuff you didn't write, like your Go install, shouldn't (in general, there are always exceptions, but this isn't one of them) be writeable by you.
Can you get the whole output, including the command you ran, and put it in a gist or something. Thanks.
On Saturday, 5 March 2016 14:42:04 UTC+11, Travis Johnson wrote:With homebrew /usr/local/* is writeable (homebrew doesn't run as root) could that be causing the problem?Probably not, but that's gross on the part of homebrew.I kinda like a package system that doesn't require root :p. Gives me some assurance it's not going to screw with anything important to my system stability.It's not so much about "who is root", but simple insurance, you're code goes in your $HOME, owned by you, writable by you. Stuff you didn't write, like your Go install, shouldn't (in general, there are always exceptions, but this isn't one of them) be writeable by you.Yea I code in my $GOPATH, which is in my home dir. But user-owned $GOROOT's aren't uncommon for me (kinda like vendoring my Go installation). I not infrequently extract a go installation in my home dir and add it to my path (and set $GOROOT, and a different $GOPATH), and start writing something to solve a problem (which is awesome because when I'm done I'm left with a static binary, but don't need to add "install go" to the system's state). Is this a workflow that's not supported?
I can't think of any reason a writeable $GOROOT should cause things to break (especially when it's still writeable), though doing anything in $GOROOT isn't to be done (at least for me).
Your initial post showed something was trying to overwrite a package that wasn't part of the stdlib inside GOROOT. Although it _is_ possible to put extra code into GOROOT, it's unexpected, and you should try to find another way to do it.
no such file or directory
bash-4.3$ echo $GOPATH/Users/tjohnson/goworkbash-4.3$ pwd/Users/tjohnson/gowork/src/github.com/conslo/badlinkbash-4.3$ go test# testmain/usr/local/Cellar/go/1.6/libexec/pkg/tool/darwin_amd64/link: cannot open file /usr/local/Cellar/go/1.6/libexec/pkg/darwin_amd64/github.com/conslo/badlink.a: open /usr/local/Cellar/go/1.6/libexec/pkg/darwin_amd64/github.com/conslo/badlink.a: no such file or directoryFAIL github.com/conslo/badlink [build failed]bash-4.3$ stat /usr/local/Cellar/go/1.6/libexec/pkg/darwin_amd64/github.comstat: /usr/local/Cellar/go/1.6/libexec/pkg/darwin_amd64/github.com: stat: No such file or directorybash-4.3$Can you try again with go test -x, and the go install -x (you said that fixed the problem temporarily)
Can you please also include the full output of go env.
$ go get github.com/conslo/badlink
$ cd $GOPATH/src/github.com/conslo/badlink
$ go install
$ go testimport "."
Should be a compiler error, please consider logging a bug, golang.org/issue/new