To give you an idea of how a workspace looks in practice, here's an example:

bin/
    hello                          # command executable
    outyet                         # command executable
src/
    golang.org/x/example/
        .git/                      # Git repository metadata
	hello/
	    hello.go               # command source
	outyet/
	    main.go                # command source
	    main_test.go           # test source
	stringutil/
	    reverse.go             # package source
	    reverse_test.go        # test source
    golang.org/x/image/
        .git/                      # Git repository metadata
	bmp/
	    reader.go              # package source
	    writer.go              # package source
    ... (many more repositories and packages omitted) ...
For convenience, add the workspace's bin subdirectory to your PATH:

$ export PATH=$PATH:$(go env GOPATH)/bin
We'll use github.com/user as our base path. Create a directory inside your workspace in which to keep source code:

$ mkdir -p $GOPATH/src/github.com/user
To compile and run a simple program, first choose a package path (we'll use github.com/user/hello) and create a corresponding package directory inside your workspace:

$ mkdir $GOPATH/src/github.com/user/hello
After the steps above, your workspace should look like this:

bin/
    hello                 # command executable
src/
    github.com/user/
        hello/
            hello.go      # command source
        stringutil/
            reverse.go    # package source

Recommend

Go 1.4 Release Notes Changes to the standard library Minor changes to the library

Go 1.4 Release Notes Changes to the implementations and tools Canonical import paths

Go 1.4 Release Notes Changes to the implementations and tools Assembly

Go 1.4 Release Notes Changes to the language Method calls on **T

Go 1.4 Release Notes Changes to the language For-range loops

Go 1.16 Release Notes Tools Vet New warning for invalid testing.T use in goroutines

Go 1.11 Release Notes Core library Minor changes to the library

Go 1.11 Release Notes Performance Compiler toolchain

Go 1.11 Release Notes Tools Vet

Go 1.11 Release Notes Tools Compiler toolchain

Go Frequently Asked Questions (FAQ) Changes from C Why are declarations backwards?

Go Frequently Asked Questions (FAQ) Implementation Can I stop these complaints about my unused variable/import?

Go Frequently Asked Questions (FAQ) Packages and Testing How do I write a unit test?

Go Frequently Asked Questions (FAQ) Type Parameters Why can't I use a more specific type for the receiver of a parameterized type?

Frequently Asked Questions (FAQ) Type Parameters Why does Go use square brackets for type parameter lists?

Frequently Asked Questions (FAQ) Control flow Why does Go not have the ?: operator?

Go Frequently Asked Questions (FAQ) Functions and Methods What happens with closures running as goroutines?

Go Frequently Asked Questions (FAQ) Functions and Methods Why do T and *T have different method sets?

Go Frequently Asked Questions (FAQ) Pointers and Allocation What is the size of an int on a 64 bit machine?

Go Frequently Asked Questions (FAQ) Pointers and Allocation Should I define methods on values or pointers?

Go Frequently Asked Questions (FAQ) Pointers and Allocation When should I use a pointer to an interface?

Go Frequently Asked Questions (FAQ) Writing Code How should I manage package versions using go get ?

Go Frequently Asked Questions (FAQ) Writing Code Why does go get use HTTPS when cloning a repository?

Frequently Asked Questions (FAQ) Values How do constants work in Go?

Frequently Asked Questions (FAQ) Types Why does Go not have covariant result types?

Go Frequently Asked Questions (FAQ) Types Why is my nil error value not equal to nil?

Go Frequently Asked Questions (FAQ) Types Can I convert []T1 to []T2 if T1 and T2 have the same underlying type?

Go Frequently Asked Questions (FAQ) Types Can I convert a []T to an []interface{}?

Go Frequently Asked Questions (FAQ) Types Why doesn't type T satisfy the Equal interface?

Go Frequently Asked Questions (FAQ) Types How can I guarantee my type satisfies an interface?

Go 1.9 Release Notes Changes to the language

Effective Go A web server

Effective Go Errors Recover

Effective Go Errors Panic

Effective Go Errors

Effective Go Concurrency A leaky buffer

Effective Go Concurrency Parallelization

Effective Go Concurrency Channels of channels

Effective Go Concurrency Channels

Effective Go Concurrency Goroutines

Effective Go Embedding

Effective Go The blank identifier Interface checks

Effective Go The blank identifier Import for side effect

Effective Go The blank identifier Unused imports and variables

Effective Go The blank identifier The blank identifier in multiple assignment

Effective Go Interfaces and other types Interfaces and methods