Learning New Programming Languages Workshop Series on Golang
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Add exercise for closures. Mar 31, 2017
docs/lessons Fix order in gitbook. Jun 10, 2017
doesExist Add packages document and koan. Jun 9, 2017
flatten Add new exercise. Jun 8, 2017
json_manipulation Add solutions to practice questions Jun 5, 2017
practice Removed practice solutions. Apr 8, 2017
reverse Add solutions to practice questions Jun 5, 2017
summer Add packages document and koan. Jun 9, 2017
template Add solutions to practice questions Jun 5, 2017
variables add variables package. May 2, 2017
.bookignore GitBook Template for Golang Workshop Mar 18, 2017
.coveralls.yml Push up coveralls yml and changes to travis ci script. Mar 19, 2017
.editorconfig Add solutions to practice questions Jun 5, 2017
.gitignore GitBook Template for Golang Workshop Mar 18, 2017
.travis.yml Push up coveralls yml and changes to travis ci script. Mar 19, 2017
LICENSE Initial commit Mar 18, 2017
README.md Update README.md link May 22, 2017
SUMMARY.md Fix order in gitbook. Jun 10, 2017
arrays.go Fix order in gitbook. Jun 10, 2017
assert.go Add conditionals go file and call functions top down in workshop_test… Mar 20, 2017
books.json GitBook Template for Golang Workshop Mar 18, 2017
builtins.go Change to failing tests. Apr 8, 2017
callbacks.go Add callbacks example. May 27, 2017
channels.go Add solutions to practice questions Jun 5, 2017
conditionals.go Fix Order in GitBook. Jun 10, 2017
data.json Add files examples to workshop. Mar 29, 2017
files.go Change to failing tests. Apr 8, 2017
functions.go Fix order in gitbook. Jun 10, 2017
go_routines.go Add solutions to practice questions Jun 5, 2017
interfaces.go Change to failing tests. Apr 8, 2017
json_example.go add variables package. May 2, 2017
loops.go Fix Order in GitBook. Jun 10, 2017
maps.go Change to failing tests. Apr 8, 2017
package.json GitBook Template for Golang Workshop Mar 18, 2017
packages.go Add packages document and koan. Jun 9, 2017
pointers.go Change to failing tests. Apr 8, 2017
simple.xml Added simple.xml Jan 20, 2018
slices.go Fix order in gitbook. Jun 10, 2017
soldiers.txt Add files examples to workshop. Mar 29, 2017
structs.go Change to failing tests. Apr 8, 2017
templates.go Add solutions to practice questions Jun 5, 2017
users.html Add solutions to practice questions Jun 5, 2017
variables.go Fix Order in GitBook. Jun 10, 2017
variadic_functions.go Add solutions to practice questions Jun 5, 2017
workshop_test.go Add packages document and koan. Jun 9, 2017

README.md

Golang Basics Workshop and Testing

Learning New Programming Languages First Workshop on Golang

Read the Golang GitBook

Install Go

GO

GOPATH

  1. Define GOPATH
    1. Using environment variables set GOPATH=/Users/marcelbelmont/go
    2. This is an example of MAC OS X
    3. Windows users might have to edit the environment variables through advanced settings
    4. Although the MSI installer should do this

Workspace

A workspace is a directory hierarchy with three directories at its root:

  • src contains Go source files

  • pkg contains package objects

  • bin contains executable commands

  • The GOPATH environment variable specifies the location of your workspace.

  • It defaults to a directory named go inside your home directory, so $HOME/go on Unix

  • %USERPROFILE%\go (usually C:\Users\YourName\go) on Windows.

Create your projects under the workspace

  • My path is /Users/marcelbelmont/go and I place all my projects under

** /Users/marcelbelmont/go/src/github.com/jbelmont **

This is a convention followed in GO to make your project go get able

MAC users should run the following command mkdir -p ~/go/src/github.com/${github-username} in terminal

Optionally just open finder and right click and folder structure manually Windows users can do the same thing

Editor

I would recommend the VSCODE Text Editor it has a nice Go extension

Download CODE

Install Go extension by clicking extension icon and type go in the market place input box then install it

  • The extension will prompt you to install some missing packages you should do this
  • Lint, Formatting, and more will be done by the EDITOR

Workshop Koans

I have created a set of practice koans for everyone to do Koans are basically tests that are failing that you need to get passing

  1. cd $GOPATH/src/github.com/${name}
  2. Run git clone https://github.com/jbelmont/golang-workshop.git in order to install the repository
  3. Run go test in order to see the first failing koan
  4. You should see filename and line number where the koan is failing. Try to make it pass

Practice

Inside the practice folder are a couple of exercises for you to try if you have time remaining

Documentation

I have added documentation for you to read at your leisure with different GO topics in the GITBOOK