Rootconf 2016

Rootconf is India's principal conference where systems and operations engineers share real world knowledge about building resilient and scalable systems.

Baiju Muthukadan

@baijum

Miles to Go: Golang Workshop

Submitted Feb 22, 2016

The primary objective of this workshop is to teach fundamentals of Go programming language. The workshop will include setting up environment for Go development, explanation about syntax & concepts and solving problems. The participants will be able to write idiomatic and effective Go code after the session. All participants will get chance to work on a small project.

Outline

This worksshop will teach all the fundamental topics related Go programming. The participants are expected to have good programming skill with any other programming language (Python, Ruby, Java, C# etc.). Participants can ask questions throught the workshop time. If the explanation requires more time and if it affects the the timeline, the discussion will be advanced to the end of session. Here is a brief outline of the session:

Total duration: 6 hours excluding lunch & tea breaks

Introduction (Time: 20 min.)

  • Welcome message: “Miles to Go: Golang Workshop”
  • About Me - Why presenting this workshop? - My background & experience with Go
  • Participant’s introductions
  • Software developer skills (5 minute group discussion) - Make participants to speak (Icebreaker)
  • Explain the plan for the workshop - briefly go through the agenda for the day
  • Few basic facts about Go - motivational speech comparing with other languages (10 min.)
  • Hello world program - show and run hello world from browser - explain the program structure
  • More reasons to use Go: Simplicity, Consistency, Readability, Safety (Type safety, Memory safety), Speed

Development Enviroment (Time: 10 min.)

  • Installation - high level overview of installation - environment variables: GOROOT & GOPATH
  • Building and running Go - go run - go build - environment variable: GOOS & GOARCH
  • Organizing code - workspace directory structure ($GOPATH) - project folder structure hosted in Github
  • Getting third party code - “go get” command
  • Formatting Go code - “go fmt” command

Fundamentals (Time: 30 min.)

  • Comments - C style - C++ style
  • Primitive types
  • Variables
  • Constants
  • Pointers
  • Interface
  • Errors
  • Command line arguments
  • Packages

Control structures (Time: 30 min.)

  • If Conditions
  • For Loop
  • Switch statement
  • Defer statement
  • Exercise

Data Structures (Time: 30 min.)

  • Structs
  • Slices and Arrays
  • Maps
  • Exercise

Functions & Methods (Time: 30 min.)

  • Type declarations
  • Function declarations
  • Method declaration
  • Exercise

Interfaces (Time: 30 min)

  • Defining interface
  • Exercise

Concurrency (Time: 30 min.)

  • Goroutines
  • Channels - send & receive
  • Mutex
  • WaitGroup
  • Exercise

Project: Webtail (Time: 2 hr.)

Q&A (Time: 30 min.)

This time will be used for further clarification about any topic that is discussed during the session.

Requirements

Knowledge and skills expected about participants:

  • Participants should have few years of experience in some other programming language (Python, Ruby, Java, C# etc.)
  • Participants should know how to use Git version control system
  • Partipants should be comfortable with one shell (Bash, Zsh, PowerShell etc.)
  • Partipants should be comfortable with one text editor (Vim, Emacs, VS Code etc.)

Other requirements:

  • Partipants should bring a laptop with power adaptor, convertors and other peripherals
  • Internet connectivity should be ensured
  • The laptop should have an operating system with Go support (GNU/Linux or Mac OS or Windows)
  • The Go 1.6 compiler should be installed (Refer this blog post: https://muthukadan.net/golang/an-introduction-to-go-programming.html )
  • Text editors like Vim, Emacs or VS Code should be installed with all required plugins and it should be ready to use

Text editor configuration:

Speaker bio

Baiju Muthukadan is a DevOps engineer working at ZeOmega, Bangalore. He has contributed to many Free/Open source softwares including Zope, Koha and Salt. He founded the Swathanthra Malayalam Computing project in 2001 while studying at REC, Calicut. He was also employed by Free Software Foundation of India in 2002-2003. He received the first Kenneth Gonsalves award in recognition of his many contributions to Python language community in India. He had conducted a 4 hour Go workshop at NIT Calicut as part of FOSSMeet’16 program. He is also writing a book about Go (http://golang.muthukadan.net).

Slides

http://go-talks.appspot.com/github.com/baijum/presentation/golang_workshop/presentation.slide

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('Post a comment…') }}
{{ gettext('New comment') }}
{{ formTitle }}

{{ errorMsg }}

{{ gettext('No comments posted yet') }}

Hosted by

We care about site reliability, cloud costs, security and data privacy