Created
April 8, 2016 10:52
-
-
Save ppanyukov/660a72e86ead14947555b1a769b58447 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Southpaw:~ philip$ export GOPATH="/Users/philip/scratch/gobook"; export PATH=${GOPATH}/bin:${PATH} | |
Southpaw:~ philip$ mkdir -p $GOPATH/src/hello | |
Southpaw:~ philip$ vi $GOPATH/src/hello/hello.go | |
// source: | |
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func main() { | |
fmt.Println("Contents of os.Args[0]:", os.Args[0]) | |
} | |
// end source | |
Southpaw:~ philip$ go install hello | |
Southpaw:~ philip$ hello | |
Contents of os.Args[0]: hello | |
Southpaw:~ philip$ $GOPATH/bin/hello | |
Contents of os.Args[0]: /Users/philip/scratch/gobook/bin/hello | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment