title: Go: "stat hello.go: no such file or directory"
body: <p>Just installed Go on Mac OS X, Yosemite Version 10.10.3, as explained in the <a href="https://golang.org/doc/install" rel="nofollow">Getting Started</a> page of the official website:</p>
  
  <blockquote>
    <p><strong>Mac OS X package installer</strong></p>
    
    <p>Download the package file, open it, and follow the prompts to install
    the Go tools. The package installs the Go distribution to
    <code>/usr/local/go</code>.</p>
    
    <p>The package should put the <code>/usr/local/go/bin</code> directory in your PATH
    environment variable. You may need to restart any open Terminal
    sessions for the change to take effect.</p>
  </blockquote>
  
  <p>I am now in the <em>Test your installation</em> section, which states:</p>
  
  <blockquote>
    <p>Check that Go is installed correctly by building a simple program, as
    follows.</p>
    
    <p>Create a file named <code>hello.go</code> and put the following program in it:</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
      fmt.Printf("hello, world\n") }
  </code></pre>
    
    <p>Then run it with the go tool:</p>
  
  <pre><code>$ go run hello.go
  hello, world
  </code></pre>
    
    <p>If you see the "hello, world" message then your Go installation is
    working.</p>
  </blockquote>
  
  <p>So, I created a <code>hello.go</code> file and, since I could not (ie: did not know how to) access the <code>/usr/local/go/bin</code> directory, I saved it on my desktop.</p>
  
  <p>Obviously, I got the following error message:</p>
  
  <pre><code>stat hello.go: no such file or directory
  </code></pre>
  
  <p>So, where should I save my Go files to be able to run them?</p>
  
  <p><strong>UPDATE</strong>: after some research, I stumbled upond this video, explaining how to set the GOPATH.</p>
  
  <p>If I want my Go workspace to be in <code>user/code/go</code>, how should I write my <code>export GOPATH=</code> command?</p>