Contents Page Previous Next

The Goblimey Scaffolder

2.1 Creating a Project

The scaffolder generates Go source code. Go source code is stored in a project directory, so you need to create one of those. As the How to Write Go Code document explains, you should structure your project as if you are going to store it in a repository. The Github is the most popular repository so I'm going to assume that you will store it there.

If you are absolutely convinced that you are not going to store your project in a repository, then you just need to create a directory in the src directory of your go project directory (so in my case, that might be /home/simon/goprojects/src/animals).

DO NOT create a project on your computer and try to store it on the github later. It's much easier to start with a github project and then clone a copy of it on your computer. So the next thing to do is create a github project.

If you don't have a Github account, create one at It's free. For example, if your name is Alun Smithie, you could create an account called alunsmithie. Your home page on the github would then be I'm going to assume that in the following examples, so replace "alunsmithie" with your github account name.

Back on your computer, create subdirectories in your goprojects directory matching the github structure (so in this example src/ and change directory to it.

In a Linux command window:

    $ mkdir -p $GOPATH/src/
    $ cd $GOPATH/src/
On Windows:

    mkdir %GOPATH%\src
    mkdir %GOPATH%\src\
    mkdir %GOPATH%\src\\alunsmithie
    cd %GOPATH%\src\\alunsmithie

On your github home page, use the "+" button at the top to create a project. If you call your projects "animals", it will have a URL something like

When you create your project, the Github will encourage you to specify what sort of licence you will issue when you publish it, and to set up a file describing what the project is about. (The for the scaffolder project is here. Most of it is created automatically by the github.)

Now you can clone your github project in your command window. It's the same command on Linux and Windows.

     git clone

That creates a directory "animals" containing a copy of any files you created on the github site - the and the license file. It also contains some magic hidden files that make it a local git repository.

Contents Page Previous Next