install go 1.2 ,but not godoc

3,681 views
Skip to first unread message

you fu

unread,
Dec 6, 2013, 10:08:11 AM12/6/13
to golan...@googlegroups.com
I install go by brew 

➜  ~  godoc
zsh: command not found: godoc


```lang=go

➜  ~  go version
go version go1.2 darwin/amd64
➜  ~  brew info go
go: stable 1.2 (bottled), HEAD
/usr/local/Cellar/go/1.1.2 (4761 files, 117M)
  Built from source
/usr/local/Cellar/go/1.2 (3980 files, 115M) *
  Poured from bottle
==> Options
--cross-compile-all
Build the cross-compilers and runtime support for all supported platforms
--cross-compile-common
Build the cross-compilers and runtime support for darwin, linux and windows
--without-cgo
Build without cgo
==> Caveats
As of go 1.2, a valid GOPATH is required to use the `go get` command:

`go vet` and `go doc` are now part of the go.tools sub repo:

To get `go vet` and `go doc` run:

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
```
and run :

and how to install godoc 

nkatsaros

unread,
Dec 6, 2013, 11:03:55 AM12/6/13
to golan...@googlegroups.com
As the caveats mention, run

Rodrigo Kochenburger

unread,
Dec 6, 2013, 12:15:54 PM12/6/13
to nkatsaros, golan...@googlegroups.com
I'm having the same issue. For some reason it does not install the bin.

I'm gonna investigate 
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
- RK

nkatsaros

unread,
Dec 6, 2013, 2:07:08 PM12/6/13
to golan...@googlegroups.com, nkatsaros
The bin is installed automatically on my machine. Maybe you don't have $GOPATH/bin on your path.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


--
- RK

Rodrigo Kochenburger

unread,
Dec 6, 2013, 2:09:54 PM12/6/13
to nkatsaros, golan...@googlegroups.com
I have $GOPATH/bin on $PATH and also double checked $GOPATH/bin itself. It's not building for some reason but also not throwing any error.

- RK


To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Sonia Keys

unread,
Dec 6, 2013, 3:57:10 PM12/6/13
to golan...@googlegroups.com, nkatsaros
I was going crazy for a while because I was typing go get code.google.com/p/go.tools/godoc instead of go get code.google.com/p/go.tools/cmd/godoc.  Be sure you're asking for the command and not just the package.

you fu

unread,
Dec 6, 2013, 8:15:22 PM12/6/13
to golan...@googlegroups.com
yei,I  typing  go get code.google.com/p/go.tools/cmd/godoc,but how to install bin dir

Rodrigo Kochenburger

unread,
Dec 6, 2013, 8:20:40 PM12/6/13
to you fu, golan...@googlegroups.com
So here is an interesting fact.

If I go to the godoc command package folder and run go build it properly builds, but go install is doing nothing: https://gist.github.com/divoxx/7836095

Any idea of what could be causing it?



- RK


Rodrigo Kochenburger

unread,
Dec 6, 2013, 8:25:37 PM12/6/13
to you fu, golan...@googlegroups.com
I just found this: https://code.google.com/p/go/issues/detail?id=6654

Looks like the go tool is not installing godoc into $GOPATH/bin but rather $GOROOT/bin. On the Mac, if you installed Go through homebrew your GOROOT will be /usr/local/Cellar/go/1.2/libexec therefore that's the location to look for godoc, so it should be added to the $PATH.

- RK

you fu

unread,
Dec 7, 2013, 1:07:41 AM12/7/13
to golan...@googlegroups.com, you fu
yes i can't find godoc 

➜  bin  ls -al  /usr/local/Cellar/go/1.2/libexec/bin/*
-rwxr-xr-x  1 fuyou  admin  11509084 12  2 09:59 /usr/local/Cellar/go/1.2/libexec/bin/go
-rwxr-xr-x  1 fuyou  admin   4316464 12  2 09:59 /usr/local/Cellar/go/1.2/libexec/bin/gofmt

minux

unread,
Dec 7, 2013, 1:39:11 AM12/7/13
to you fu, golang-nuts
On Sat, Dec 7, 2013 at 1:07 AM, you fu <fuyo...@gmail.com> wrote:
yes i can't find godoc 
have you done:

➜  bin  ls -al  /usr/local/Cellar/go/1.2/libexec/bin/*
-rwxr-xr-x  1 fuyou  admin  11509084 12  2 09:59 /usr/local/Cellar/go/1.2/libexec/bin/go
-rwxr-xr-x  1 fuyou  admin   4316464 12  2 09:59 /usr/local/Cellar/go/1.2/libexec/bin/gofmt

PS: I don't know if the authors for the homebrew formula is on this list, but I don't understand two
of the choices they made:
1. why set GOROOT=Cellar/go/VERSION/libexec? why not just set GOROOT to Cellar/go/VERSION/?
2. why you don't build godoc, vet as as part of the installation procedure just like what we do for
the binary distributions? Just set GOPATH to a temporary directory, do the go get and remove
the intermediate directory.

Jesse McNelis

unread,
Dec 7, 2013, 1:41:25 AM12/7/13
to you fu, golang-nuts
On Sat, Dec 7, 2013 at 2:08 AM, you fu <fuyo...@gmail.com> wrote:
> I install go by brew
>

Every time there has been a homebrew package of Go it has been broken.
Why do people still try to use homebrew, it's just broken.


--
=====================
http://jessta.id.au

minux

unread,
Dec 7, 2013, 1:50:22 AM12/7/13
to Jesse McNelis, you fu, golang-nuts
On Sat, Dec 7, 2013 at 1:41 AM, Jesse McNelis <jes...@jessta.id.au> wrote:
On Sat, Dec 7, 2013 at 2:08 AM, you fu <fuyo...@gmail.com> wrote:
> I install go by brew
Every time there has been a homebrew package of Go it has been broken.
i agree. although i use homebrew, i won't ever use their Go formula.
the formula try to do much (like support cross compilation), but often missed the
the essential (e.g. it once had an issue that if you enable the cross compilation
support, you can't use cgo even when native compiling)
Why do people still try to use homebrew, it's just broken.
well i think it's because the only other alternative, macports, is just (much) more
broken.

you fu

unread,
Dec 7, 2013, 2:24:46 AM12/7/13
to golan...@googlegroups.com, you fu
should i set GOPATH=what and then typing go get code.google.com/p/go.tools/cmd/godoc? and need go install .
could you give me some step?
thanks!

minux

unread,
Dec 7, 2013, 2:30:19 AM12/7/13
to you fu, golang-nuts
On Sat, Dec 7, 2013 at 2:24 AM, you fu <fuyo...@gmail.com> wrote:
should i set GOPATH=what and then typing go get code.google.com/p/go.tools/cmd/godoc? and need go install .
could you give me some step?
thanks!
Do you have GOPATH set already? If not, I'd suggest you first read golang.org/doc/code.html and set up your
GOPATH before doing the "go get".

Of course, if you don't want to pollute your existing GOPATH, you can do something like this:
(substitute /tmp/temp_gopath to some temporary directory that doesn't exist yet)
GOPATH=/tmp/temp_gopath go get code.google.com/p/go.tools/cmd/godoc
rm -rf /tmp/temp_gopath

you fu

unread,
Dec 7, 2013, 6:32:16 AM12/7/13
to golan...@googlegroups.com, you fu
Thanks!,it's work right!
Reply all
Reply to author
Forward
0 new messages