Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK finally I found what's wrong with my environment:</p> <p>Since I'm using OS X so I used .pkg file to install go, and the GOROOT is "/usr/local/go"</p> <p>Then I read another fake tutorial about GO installtion and it says I had to define GOROOT in my ~/.profile, so I added "GOROOT="/usr/local/go" inside ~/.profile, then everything went wrong.</p> <p>After carefully read the official document I found this:</p> <blockquote> <p>The Go binary distributions assume they will be installed in /usr/local/go (or c:\Go under Windows), but it is possible to install them in a different location. If you do this, you will need to set the GOROOT environment variable to that directory when using the Go tools.</p> <p>For example, if you installed Go to your home directory you should add the following commands to $HOME/.profile:</p> <p>export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin</p> </blockquote> <p>But the problem is, it did't mention what will happen if you add GOROOT in ~/.profile after .pkg installation, and it also didn't say you can't do this.</p> <p>Here is my ~/.profile look like now (being corrected):</p> <p>export GOPATH=$HOME/projects/ export PATH=$PATH:$GOPATH/bin</p> <p>BTW: you don't NEED to make /project folder under workspace. According to <a href="http://golang.org/doc/code.html#tmp_2" rel="nofollow">http://golang.org/doc/code.html#tmp_2</a> , it also did't say you have to:</p> <blockquote> <p>The workspace directory tree now looks like this:</p> </blockquote> <pre><code>bin/ hello # command executable pkg/ linux_amd64/ example/ newmath.a # package object src/ example/ hello/ hello.go # command source newmath/ sqrt.go # package source </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload