Welcome to the second Boston Go language lab!
The goal of this lab is to practice writing tests by create some unit tests for some open source projects.
We have identified some projects in the projects/ folders with instructions.
- PLEASE BRING: A laptop with a Go language environment with Go 1.4 already set up. Please see 'Vagrant setup' below to get started with one easily.
- If you are having trouble setting up your Go programming environment, please join the #lab-help channel in the Boston Golang Slack group. You can signup for the Slack group here.
- PLEASE BRING: A text editor or IDE suitable for writing Go code.
- For beginners, Sublime is a good option. Make sure you install the Go plugin here.
- For VIM users, there is a pretty nice VIM setup here.
- For IDE users who want to use an IDE made for Go, LiteIDE is a good IDE that's easy to use.
- PLEASE HAVE: Some basic Go language exposure. You should be familiar with the Go basics: e.g., Go's types, structs, control flow structures, goroutines, and channels.
Other programming language experience and concepts (such as networking, etc) will be helpful. A good introduction to the basics of Go for people familiar with other programming language is available at: https://tour.golang.org. If you can get through this tour, you will be well-prepared for this meetup!
-
Fork this repository in Github.
-
Clone the repository into a directory
# open a terminal window and type:
$ git clone https://github.com/bostongolang/golang-lab-testing.git
- Install Vagrant for your platform.
- Open a terminal window, and cd /path/to/this/repository.
# open a terminal window and type:
$ cd golang-lab-testing
- From within the
golang-lab-testing
directory, typevagrant up
. This will create a virtual machine with Ubuntu linux and Go 1.4 installed for the Vagrant user. - Type
vagrant ssh
to ssh into the virtual machine.
Within the virtual machine, golang-lab-testing
on the host computer
will be mapped to /opt/golang-lab-testing in the guest. So any changes
you make in the normal filesystem should be reflected in the VM!
Need help? Arrive a little early and we can help you get up-and-running, or join the Boston Golang Slack group #lab-help channel group by signing up here.
You can also email me directly: [email protected].
Projects are organized into 'basic' and 'advanced'. Basic tests require very little experience and will walk you through the types of tests to create, the advanced tests are more free form (although some guidance is provided).
Projects are listed below roughly in order of least -> most difficult, also included is some basic background of knowledge/content you should have to be able to successfully write the tests:
- timeago - no knowledge required
- gocsv - knowledge of CSV files helpful
- go-notify - basic knowledge of channels, goroutines helpful
- passwd - knowledge of /etc/passwd files format (nice but not required)
- sshconfig - knowledge of ~/.ssh/config files format (nice but not required)
- redis - some knowledge of Redis helpful