Go lang - Revel Web Framework - .gitignore file starter sample | MyThinkPond

gorevelframeworkFor those of you trying to create a new Go Language - Revel Web Framework based project, here is a sample .gitignore file.

But before I provide you with the information, we need to discuss the project structure. If you visit the Revel site here, you will see their organization structure of a Revel project. In my case, their my_gocode/ folder is much deeper in what I store in my BitBucket account (or GitHub for that matter).

.
├── code
│   ├── bin
│   │   └── revel
│   ├── pkg
│   └── src
│       ├── github.com
...
│       ├── golang.org
...
│       ├── gopkg.in
...
│       └── mywebsite.com
│           └── web
│               ├── app
│               │   ├── controllers
│               │   │   └── app.go
│               │   ├── init.go
│               │   └── views
│               │       ├── App
│               │       │   └── Index.html
│               │       ├── debug.html
│               │       ├── errors
│               │       │   ├── 404.html
│               │       │   └── 500.html
│               │       ├── flash.html
│               │       ├── footer.html
│               │       └── header.html
│               ├── conf
│               │   ├── app.conf
│               │   └── routes
│               ├── messages
│               │   └── sample.en
│               ├── public
│               │   ├── css
│               │   │   └── bootstrap.css
│               │   ├── img
│               │   │   ├── favicon.png
│               │   │   ├── glyphicons-halflings.png
│               │   │   └── glyphicons-halflings-white.png
│               │   └── js
│               │       └── jquery-1.9.1.min.js
│               ├── README.md
│               └── tests
│                   └── apptest.go
├── design
│   ├── logo-design1.png
│   ├── logo-design1.psd
│   ├── logo-final.png
│   └── logo-design2.psd
├── resources
│   └── some-materialcss-templates
...

As you can see my structure also includes some PhotoShop artefacts that also needs to be stored in my BitBucket (GIT) project. In my case, I want to ignore some of the go lang artefacts and revel artefacts.

So in the project-root, I created a .gitignore with the following contents relative to my project-root:

code/bin/
code/pkg/
code/src/github.com/
code/src/golang.org/
code/src/gopkg.in/

The above tells GIT to ignore the “github.com/”, “golang.org/” and “gopkg.in/**” subdirectories. As you add additional dependencies, you can revise and add to the above .gitignore file as needed.

Cheers!

Venkatt Guhesan avatar
About Venkatt Guhesan
Enterprise Software Architect currently working at DataDirect Networks developing a highly scalable monitoring solution called DDN Insight. My passions include all things Open Source including Linux (CentOS, Red Hat, Gentoo, Open Stack, Docker & Ubuntu), embedded ARM processors and microcontrollers (Arduino, UDOO, Cubieboard, BeagleBoard, OnionIO, TI's Zigbee). Coming from an Electrical and Computer Engineering background, working in developing and designing enterprise - distributed, highly scalable software requires a unique set of software skills with a good understanding of the hardware. This makes his work challenging and interesting. In his free time, he spends his time with his family and two children. He also enjoys researching on topics including - world ancient history and yoga. Visit the 'About' section for more details.
comments powered by Disqus