Complete Guide to Application Development with Go
3.9 (11 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
123 students enrolled

Complete Guide to Application Development with Go

Unlock the mysteries of Go to build powerful applications with amazing tips and techniques to dodge common roadblocks
3.9 (11 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
123 students enrolled
Created by Packt Publishing
Last updated 3/2019
English
English [Auto-generated]
Current price: $129.99 Original price: $199.99 Discount: 35% off
15 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 9.5 hours on-demand video
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Manipulate string values and escape special characters.
  • Write concurrent functions and handle synchronization.
  • Perform CRUD operations on a relational database.
  • Utilize concurrent features and understand the caveats of synchronization.
  • Tackle the most common “plumbing” issues when building Go Microservices.
  • Build and package your application efficiently for a multitude of different platforms.
  • Prevent crashes in production by remembering just a few simple techniques.
Course content
Expand all 176 lectures 09:17:05
+ Hands-on with Go
56 lectures 02:25:42

This video will give you an overview about the course.

Preview 00:44

In this video, we will learn Installing the Go binaries to the local computer.

   •  Download the Go binaries from the internet

   •  Use the installer, installing the Go binaries

   •  Setup the GOPATH environment variable and workspace folders

Installing Go Binaries
03:25

In this video, we will take a quick look at how Go looks like and where to learn more about the basic syntax.

   •  Check out the Go tour website

   •  Check the basic syntactical differences of Go compared to other programming languages

Quick Look at Go Language
03:07

In this video, we will look at how to trim spaces from beginning to end.

   •  Use the built-in functions, we are removing the spaces

Preview 03:16

In this video, we will look at how to extract substrings from string values.

   •  Define the string from which we are going to extract a piece

   •  Use the slices syntax, we are extracting a piece from the given string value

Extracting Substrings from String Values
02:11

In this video, we will learn to replace parts of a string.

   •  Use strings.Replace() built-in function, to replace a given string with something else

Replacing Parts of a String
03:05

In this video, we will look at escaping characters in strings.

   •  Use back slash character to escape special characters in string values

Escaping Characters in Strings
03:15

In this video, we will learn how to capitalize string values.

   •  Use strings.Title(), to capitalize the first letters of words

   •  Use strings.ToUpper(),to capitalize all the letters of a given word in a string value

Capitalizing String Values
02:27

In this video, we will convert bool to string.

   •  Use strconv.FormatBool() built-in function,to convert Boolean to string value

Converting Boolean to String
03:59

In this video, we will convert integer and float values to string.

   •  Use strconv.FormatInt(), to convert the integer values to string

   •  Use strconv.FormatFloat(),to convert float to string

Converting Integer and Float Values to String
05:55

In this video, We will parse string values to bool.

   •  Use strconv.ParseBool()

Parsing String Values to Boolean
02:37

In this video, we will parse string values to integer and float.

   •  Use strconv.ParseInt()

   •  Use strconv.ParseFloat()

Parsing String Values to Integer and Float
03:05

In this video, we will convert a byte array to string.

   •  Use string() built-in conversion

Converting a Byte Array to String
02:11

In this video, we will be finding today’s date and time.

   •  Quick demonstration to time package

   •  Use time.Now() function as defined under time package

Finding Today's Date and Time
02:06

In this video, we will be adding or subtracting from date.

   •  Get the current date and time with time.Now()

   •  Use the .AddDate() function over the values of type time

   •  Pass negative parameters to AddDate() function to subtract

Adding or Subtracting from Date
03:12

In this video, we will find the difference between two date and time values.

   •  Define two time types using time.Date() function

   •  Use .Sub() function of the first to subtract the second

Finding the Difference Between Two Dates
01:15

In this video, we will be parsing the date values in type of string to actual date and time types in Go.

   •  Define a simple date in string format and defining the layout to use to instruct Go for how to parse the given string

   •  Use time.Parse() function to parse

Parsing Dates and Times from Strings
02:10

In this video, we will be extracting unique elements from a given list.

   •  Define a new function called unique()

   •  Create a new list to store the unique elements

   •  Check if the iterated item already exists in the list, not adding it to the unique items list

Extracting Unique Elements from a List
02:46

In this video, we will be finding an element from an array.

   •  Define a new list with elements

   •  Use for loop and range operator, iterating each item and checking if it is what we want

Finding an Element from an Array
03:00

Revert the order of an array.

   •  Define an new list with elements

   •  Use sort package and the methods defined under it such as .Sort(), and .Reverse()

Reverting an Array
01:30

In this video, we will be iterating an array.

   •  Use for loop

   •  Range operator constructs

Iterating over an Array
01:50

In this video, we will be adding all of the items of map into an array as key-value pairs.

   •  Create a new struct type which will keep the key/value pairs as fields

   •  Iterate the map to get each key and its corresponding value

   •  Add each key-value pair to the list

Converting a Map into an Array of Keys and Values
02:01

In this video, we will be merging two arrays into one.

   •  Create two simple maps with elements

   •  Use append() built-in functions and passing both of the arrays

Merging Arrays
01:38

In this video, we will be merging two maps into one.

   •  Create two simple maps populated with elements

   •  Iterate one of the maps and inserting its keys and values to the other map

Merging Maps
02:03

In this video, we will be checking if a key exists in a map.

   •  Use the special syntax to check the existence of a key in a given map

Testing for the Presence of a Key in a Map
02:50

In this video, we will be creating custom error types for collecting more information about a custom error handling situation.

   •  Create a new struct

   •  Implement the Error() method to satisfy the Error interface

Creating Custom Error Types
02:52

In this video, we will be handling errors in Go.

   •  Show how to handle errors returned from function calls

Try/Catch Equivalent in Go
03:16

In this video, we will be logging various state of the application including errors and information.

   •  Use the built-in mechanism

   •  Save the log information to a file

Doing a Simple Logging in Your App
02:18

In this video, we will be recovering from a panic.

   •  Panic in the application

   •  Use the delay and recover keywords, gracefully recovering from the panic state

Gracefully Dealing with Panics
03:41

In this video, we will be checking whether a file exists in a given location or not.

   •  Create a temporary file

   •  Use os.Stat() function, checking if the file exists

Checking the Existence of a File
02:10

In this video, we will be reading the entire content of a given file into memory.

   •  Create the file to read

   •  Use ioutil.ReadFile() function, reading its content into memory

Reading the Entire Content of a Text File
01:14

In this video, we will be writing an in memory string value into a new file.

   •  Use ioutil.WriteFile() function, writing the content into a file

Writing to a File
01:52

In this video, we will be creating a file that is located in a temporary location.

   •  Use ioutil.TempFile(), creating a new temporary file

   •  Write some text content into the created temporary file

Creating Temporary Files
02:04

In this video, we will be counting how many lines in a given file and displaying it on the console.

   •  Use os.Open() function, loading the file into the memory

   •  Use bufio.NewScanner(), counting how many lines in the file

Counting Lines in a File
01:25

In this video, we will be reading just a desired line from a given file.

   •  Use os.Open() function, loading the file into the memory

   •  Use bufio.NewScanner() and .Scan() function, we read the line into a new variable

Reading a Particular Line in a File
01:44

In this video, we will be loading two text files into memory and comparing their content with each other.

   •  Load both of the files into memory

   •  Use bytes.Equal() function to compare the two files contents

Comparing the Contents of Two Files
01:35

In this video, we will be deleting a given file from its physical location.

   •  Use os.Remove() function and provide it with the location of the file, deleting the file

Deleting a File
01:11

In this video, we will be copying and later moving file from one location to another.

   •  Create a file to copy and move

   •  Copy the file by creating a new copy of it in the desired location

   •  Copy the file by creating a new copy of it in the desired location and removing the original file from its physical location

Copying or Moving a File
02:17

In this video, we will be renaming a given file.

   •  Use os.Rename() function and provide it with the physical file location and the new file name to rename it to

Renaming Files
00:39

In this video, we will be deleting a physical folder and its content along with it.

   •  Use os.Remove() function to remove a folder without sub folder and files in it

   •  Use os.RemoveAll() to remove both the folder and all of its files and sub folders

Deleting a Directory and Its Contents
01:14

In this video, we will be reading all of the file names from a given directory into the memory.

   •  Use the ioutil.ReadDir() function, reading all the files names into memory variable

List All the Files under a Directory
01:07

In this video, we will be running multiple Go functions in a concurrent manner.

   •  Use Go keyword to run functions as Go routines, which are what runs as a concurrent function in Go programming language

Running Multiple Functions Concurrently
08:15

In this video, we will be passing data between multiple concurrent functions while they are being executed.

   •  Use the channel construct to synchronize

   •  Pass data between concurrent functions

Passing Data Between Concurrently Running Functions
03:35

In this video, we will be waiting all of the running concurrent functions to finish in the main Go routine.

   •  Use sync.WaitGroup(), waiting for all the Go routines to finish

Waiting for All Concurrent Functions to Finish
01:58

In this video, we will be getting the results of multiple concurrent functions as they are running.

   •  Use the select keyword to get the returned values through channels

Selecting the Results of Concurrent Functions
03:04

In this video, we will catch the OS-level signals coming from other processes.

   •  Use signal.Notify() function to get the signals passed to your Go application

   •  Output them to the console

Catching Signals
03:47

In this video, we will be running another process from Go applications.

   •  Use exec.Command() function, running ls command that is available on Unix and Linux based operating systems

Running Child Processes
03:09

In this video, we will be reading the arguments passed to the Go application and process a different action based on the passed arguments.

   •  Use the os.Args slice to read the passed arguments from command line

   •  Run writeHelloWorld() function for an argument called “a”

Processing Command-line Arguments
03:43

In this video, we will be downloading a given URL content from internet.

   •  Use http.Get() to get the content of the URL

   •  Access the Body property of the returned object, writing the content to the console

Downloading a Web Page from Internet
01:51

In this video, we will be downloading an image file from a given URL.

   •  Use the http.Get() function, getting the file

   •  Create a new file in the file system

   •  Write the content of the downloaded image into the new file created in the file system

Downloading Files from Internet
01:30

In this video, we will be creating a simple web server that handles HTTP request and returns response.

   •  Use http.HandleFunc() and http.ListenAndServe() functions

   •  Create a simple web server that handles requests on port 5050

Creating a Simple Web Server
04:00

In this video, we will be creating a simple file server that serves static files such as images, JavaScript files, CSS files, and so on.

  • Use http.FileServer() function in http.Handle() function to serve static files

  • Use http.ListenAndServe() to listen to the requests coming through 5050 port on the localhost

  • Serve the static content accordingly

Creating a Simple File Server
02:18

In this video, we will be reading data records from SQLite database.

  • Use go get command, downloading third-party SQLite database package first

  • Use the database/SQL built-in package to interact with database

  • Read data from the database using db.Query() function

Reading Data from SQL Databases
06:21

In this video, we will be inserting data rows into SQLite database.

  • Use the database/ SQL built-in package to interact with database

  • Use db.Prepare() and .Exec() function to insert the desired data

Inserting Data to Database
01:41

In this video, we will be updating an existing record in the database.

  • Use the db.Prepare() and .Exec() function to update an existing record with desired values

Updating Data in Database
01:55

In this video, we will be deleting an existing record in the given database table.

  • Use the db.Prepare() and .Exec() function to delete an existing record

Deleting Data from Database
02:18
Test your knowledge
5 questions
+ Advanced Go Programming in 7 Days
48 lectures 03:04:01

This video will give you an overview about the course.

Preview 01:57

In order to make the most of the contents of this course, you are expected to have working knowledge of Go and understand the basics.

  • Have latest Go installed

  • Have a programmers editor installed

  • Have #GOPATH, $GOROOT configured

Installation
02:15

Understand the important characteristics of Go as a language and the tradeoff of its design. Learn about the most common use cases in Go and how fast can it be.

  • Understand that Go is fast enough to be productive and efficient

  • Understand that Go is simple but opinionated

  • Understand that Go has a lot of real world use cases

Programming with Go
02:59

Mastering Go first means mastering how input and output interactions work in the language. In this section we show how important is to write idiomatic Go when handling input and output operations so that the abstractions can tie together with the rest of the Go ecosystem.

  • Understand log, fmt and interactions with the operating system

  • Understand io, buffered io, and scanners

  • Understand io.reader and io.writer interfaces

Efficient Handling of Input and Output
05:44

Error handling is crucial in writing robust and enterprise ready solutions. We need to understand and embrace Go error handling in a way that it will help us catch and handle all errors that may occur in our solutions.

  • Understand what are errors and error handling in Go

  • Learn how to print the stack trace

  • Understand the caveats of panics and how to recover

Error Handling Techniques
04:58

Understanding how imports and special packages work is an important factor when working with Go. Layering down a naming plan for source code will help scale out the application so that multiple teams can work together with minimal frictions.

  • Understand imports, exporting identifiers and why package names matter

  • Understand special packages and how to organize them in a logical manner

  • Understand why Makefiles help with program automation

Source Code Organization and Packages
03:25

A process monitor is a command line tool that queries and shows relevant information about Operating System processes. On top of that it offers the ability to filter a process by id or stop a process by id. Your task for today is to implement this tool using the information we showed today.

  • Write initial code to poll the OS for process information

  • Use the poll function to query and print specific process information

  • Add additional options to filter the results by process id

Daily Task: Write a Process Monitor
01:10

We review yesterday’s task, which was a process monitor, and propose a sample implementation.

  • Write code to invoice a process to retrieve the process information

  • Use a go-routine to poll every 10 seconds

  • Print results in screen

Exercise Review
01:49

In this video, we talk about the kinds of types in Go and understand how the type system works.

  • Understand basic and composite types

  • Understand underlying types

  • Understand type casts

Go Type System
04:29

In this video, we talk about the string and rune types in Go and how they are represented in memory.

  • Understand the String representation

  • Understand string operations

  • Understand rune representation and conversions

All about Strings and Runes
02:53

In this video, we talk about functions and closures in Go and how we compose functions together.

  • Understand functions as types

  • Understand function calls

  • Understand function compositions

Function Declarations and Calls
01:57

In this video we talk about pointers and pointer operations in Go and how to use structs.

  • Understand what pointers are and how we use them

  • Understand structs, type methods and comparisons

  • Understand anonymous structs

Pointers and Structs
04:39

In this video, we talk about interfaces and composition and how to use type modeling in Go.

  • Understand interfaces and polymorphic rules

  • Understand type embedding

  • Understand type compositions

Interfaces and Type Modeling
03:58

In this video, we talk about the common container types in Go such as arrays slices and maps and what are their operations.

  • Understand arrays

  • Understand slices

  • Understand maps

Container Types
01:39

In this video, we talk about channels and how are they used in Go as a communication tool between coroutines.

  • Understand closing of channels

  • Understand build-in methods of channels

  • Understand select on channels

Channels
02:35

In this video, we talk about the reflection capabilities of the language and how reflection helps in several cases.

  • Understand reflection Type

  • Understand common reflection methods

  • Understand reflection value

Reflection
02:50

In this video, we talk about the build-in concurrency facilities in Go and how can they be used at runtime.

  • Understand go-routine states

  • Understand closures in go-routine

  • Understand go-routine synchronization pitfalls

Goroutines
02:13

A markdown processor is a tool that parses a text written in Markdown format and outputs the equivalent in HTML. Your task for today is to implement this tool using the information we showed today.

  • Implement parsing of text into a Tree

  • Implement rendering of a Tree into HTML

  • Implement at least 3 inline rules

Daily Task –Implement a Markdown Parser
02:28

We review the yesterday’s task which was the markdown processor and propose a sample implementation using interfaces and type composition.

  • Define interface types to map to each markdown element types

  • Provide a Parse method to create an intermediate representation tree of the markdown text

  • Provide a Render or WriteTo method to parse the intermediate tree into an output format such as HTML and output to the console

Exercise Review
01:58

Writing reusable library code is important to know how to do it. We need to understand how libraries are used and how to provide the best APIs for them without breaking compatibility.

  • Understand what are Libraries

  • Understand how libraries are used

  • Understand how we structure library code

Aspects of Library Development
01:41

Algorithms and Data Structures and important to implement as libraries as the expose useful functionality to clients consuming them. They almost become indispensable in bigger programs that solve complex engineering problems. In this section we are going to implement a Set data structure.

  • Define the abstract representation of the Set data structure

  • Provide an implementation detail of the Set operations

  • Expose a simple and convenient API to clients

Writing Algorithms and Data Structures Like Trees and Sets
03:22

GitHub is a cloud service that handles git repositories. They have a vast REST API that covers a lot of their operations. In this section, we are going to implement a REST API client library that can be used to consume operations using the exposed API.

  • Implement the basic http client tool

  • Implement methods to request and handle API payloads

  • Implement a method to consume an endpoint

Writing a GitHub API Library
05:34

A blockchain is a data structure as a growing list of records called blocks that are linked using cryptographic methods. A blockchain SDK is a library tool that helps with creating and handling those records in a secure way. In this section we are going to implement this SDK and expose the most important methods and interfaces.

  • Define basic abstractions like Block, Blockchain and transaction

  • Implement method to create Blocks, Blockchains and Transactions

  • Verify with a small example that the block invariants are correct when using the SDK

Writing a Blockchain SDK
03:50

A logging tool is a library element that helps with recording useful information about a program at runtime. In this task you are to implement a simple logging library that offers structured logging and writing to the console.

  • Create initial code for handling structured logging

  • Use locks to prevent issues with overlapping of messages

  • Write log output to console

Daily Task: Write a Logging Library
01:25

We review the yesterday’s task which was the logging tool and propose a sample implementation.

  • Define the logging levels

  • Implement code to log information based on the current logging level

  • Implement code to change the current level and print to console

Exercise Review
02:11

Command line applications are tools that are meant to be used from a command line. They are typically standalone and the offer a lot of functionality out of the box. In this section, we are going to show the important implementation details when working with command-line tools and what makes them less error prone.

  • Understand the usage of the flag package

  • Understand why it’s important to validate command line flags

  • Learn where CLI tools reside in a project

Aspects of Command-Line Application Development
00:49

A file search tool is a CLI that helps with searching in directories for file names or patterns matching a file name or directory. In this example we are going to implement this tool and how to handle different flag parameters.

  • Write the required flag parameters and validate them

  • Write a performSearch method that will recursively search the define path for matching files or directories

  • Compile and test the tool in the command line

Writing a File Search Tool
05:54

Curl is a command line tool for performing HTTP requests and it’s widely used in development. In this example we are going to implement this tool and understand the common patterns of HTTP clients.

  • Write the required flag parameters and validate them

  • Write the performRequest method to execute the request for the specified URL

  • Compile and test the tool in the command line

Writing a Curl Tool
07:48

A key-value database is a program that helps with persisting dictionaries of objects or collections in the disk. They offer a lot of flexibility in terms of scalability and ease of usage. In this example we are going to implement our own version of MongoDB using .json files and test it with a simple HTTP client.

  • Write the library code to write json files to disk based on a key parameter

  • Provide methods to read, write, delete to files

  • Write a http server to utilize the tool in the command line using curl and test that the actions are performing as expected

Writing a Key-Value Database
06:21

Stack Overflow is a very popular site that hosts Q/A and tech-related information with a reward factor. One cool way we can automate searching for engineering questions is to using it from the command line. In this task you are asked to create this tool that will query the top answer for a particular questions using the Stack Exchange API.

  • Define the command line client

  • Implement the http client that will query the API

  • Parse the response and print the top answer in a readable form

Daily Task – Write a Stack Overflow Search Tool
01:15

We review the yesterday’s task which was a Stack Overflow search tool and propose a sample implementation using an http client

  • Find the correct endpoint

  • Write the client to performSearch

  • Use the information provided to request the answer and parse the result

Task Overview
01:27

Server side code is relatively easy to write in Go as the standard library has a plethora of tools to build configurable servers. In this video we list the most important aspects of server side software in Go.

  • Understand that there are multiple protocols each with its own caveats

  • Understand that concurrency is used more frequently

  • Understand that servers require more resources from the Operating system

Aspects of Server-Side Application
00:54

TCP is a communication protocol that allows persistent and connection oriented messages between endpoints. In this sections we are going to see examples of a TCP client and server as well as how to handle TCP connections.

  • Understand how to initiate TCP requests

  • Understand how to initiate TCP servers

  • Understand how to handle TCP connections

Building a TCP Server
02:53

UDP is a communication protocol that allows connectionless parties to exchange information. In this sections we are going to see examples of a UDP client and server as well as how to handle UDP connections.

  • Understand how to initiate UDP requests

  • Understand how to initiate UDP servers

  • Understand how to initiate UDP connections

Building a UDP Servers
01:53

Web frameworks are a collection of cohesive tools that aid in the development of Web applications and servers. In this video we are going to design and implement a simple yet easy to use Web frameworks and create our first application with that.

  • Understand how to build web application frameworks

  • Understand how routing works in Web Frameworks

  • Understand more about Web Framework contexts

Develop a Web Framework
03:56

A CORS anywhere server is a server that process Cross origin requests from one endpoint to another by manipulating some headers. In this task you are asked to create this server using the knowledge you gained from today’s videos.

  • Write initial code to handle CORS headers

  • Write code to proxy requests

  • Test the server with an example request

Daily Task – Writing an CORS Anywhere Server
01:13

We review the yesterday’s task which was a CORS anywhere server and propose a sample implementation.

  • Create a minimal server that proxies requests

  • Implement the handleCorsRequest method to pass manipulate the CORS headers

  • Test your server with a simple example

Task Overview
02:07

Microservices is a Software Architecture style that breaks the functionality of monolithic applications into small, re-usable services that are individually deployable. In this video we define the most important benefits of using microservices.

  • Understand why we break monoliths into microservices

  • Understand how microservices are easier to scale

  • Understand the caveats of microservices

Aspects of Microservice-Based Application
02:01

Domain Driven Design is an approach to software development that places importance on the core domain logic and knowledge. In this video we are going to structure an initial issue tracker microservice using DDD that evolves as we grow it.

  • Understand why domain logic is not tied to external dependencies

  • Understand how to structure a domain project and separation of concerns

  • Understand how to assemble implementation details in the main app

Domain-Driven Design
10:14

Databases integration plays an important part when developing micro services as the state of the application must be reasonably modeled for efficiency. In this video we see an example implementation of a repository pattern using SQL.

  • Understand how the database/sql package works

  • Understand how to perform data definition queries

  • Understand how to perform data manipulation queries

Issue Tracker Microservice – Databases
06:45

The first major goal when developing micro services is to manage authentication and user registration. In this video we are going to see how we can add an Auth microservice and integrate JWT tokens in our application

  • Understand why is important to separate User accounts from User details

  • Understand how JWT tokens work

  • Understand that micro services need to communicate with each other in a secure but flexible way.

Issue Tracker Microservice – Authorization
11:13

A Paginator is a service that map query parameters in order to configure limit and offset requests from a database object. In this task you are to implement this service.

  • Define the Paginator service

  • Pass query parameters from requests down to the SQL executions

  • Return list of results mapping the current pagination parameter

Daily Task – Implement a Paginator
01:16

We review the yesterday’s task which was a Paginator service server and propose a sample implementation.

  • Implement the required service

  • Modify existing code to accommodate the extra pagination options

  • Test that the pagination works correctly

Task Overview
03:09

API gateways are frontend proxy services that enable clients to retrieve data from multiple services with a single round-trip by offering a unified endpoint to them. In this example we are going to integrate Traefik as a gateways service for our project.

  • Understand why API gateways exist

  • Understand how to configure Traefik

  • Test that the configuration works

API Gateways
06:58

RPCs are protocols that one service can use to request a service from a program located in another computer on a network without having to understand the network's details. I this example we are going to setup a gRPC server that will communicate between 2 micro services on our issue tracker.

  • Understand how to write protobuf definitions

  • Understand how to setup gRPC clients

  • Understand how to setup gRPC servers and test that they work

Microservice Communication Patterns – RPCs
08:37

Message queues are software applications that relay messages between applications. The idea is to provide async communication and to decouple senders from receivers. In this example we are going to integrate Kafka and use Event sourcing to pass messages between our micro-services.

  • Understand how to install and configure a message queues like Kafka

  • Understand how to create and handle events and what is event sourcing

  • Understand when to use message queues

Microservice Communications Patterns: Message Queues
12:09

12 Factor Apps are a methodology to achieve a high level of structure when developing software that are cloud friendly, team friendly and interoperable by default. In this video we are going to visit each one of the factors and what can we do to integrate them in our applications.

  • Understand what the 12 Factors are

  • Understand why they are important

  • Understand how to integrate them into our services.

12 Factor Apps
08:20

In the last task you are going to finish the rest of the issue tracker micro service by implementing the rest of the CRUD endpoints, add user registration and investigate how to add user permissions, and authorizations.

  • Implement the rest of the CRUD methods

  • Implement user account registration and add the necessary RPC calls

  • Add basic support for authorization roles

Daily Task – Issue Tracker Microservice
02:50
Test your knowledge
5 questions
+ Go Application Development – Tips, Tricks, and Techniques
30 lectures 02:05:07

This video gives a glimpse of the entire course.

Preview 02:38

In this video, we’ll install and setup VS Code which will help you code with maximum efficiency.

  • Download VS Code

  • Install VS Code

  • Setup VS Code

Setting Up VS Code
03:41

In this video, we’ll explore the features of VS Code.

  • Run commands

Common VS Code Commands
05:05

In this video, we’ll explore the Select Statement.

  • Understand Go Channels

  • Execute the Select Statement

  • Add a logger to our application

The Select Statement
02:44

In this video, we’ll learn the practical and useful application of the Select Statement.

  • Understand the problem

  • Explore the solutions

  • Add custom loggers to the application

Implementing Timeouts Using Select
03:06

In this video, we’ll learn about the observer pattern and how to implement it efficiently using Go Channels.

  • Understand the observer pattern

  • Implement observer pattern

  • Show how to manipulate custom levels with JConsole

Building Asynchronous Observers with Channels
03:37

In this video, we’ll learn about Race Conditions and how we can detect them.

  • Understand Race Condition

Detecting Race Conditions
05:13

In this video, we’ll learn how to prevent the Race Conditions by using the features offered by the sync package.

  • Understand Mutual Exclusion

Using the Sync Package
04:28

Often, JSON data should be either read directly from a stream or written directly into a stream. This video explains the usage of the “json.Decoder” and “json.Encoder” types to accomplish this.

  • Recapitulate on the “io.Reader” and “io.Writer” interfaces

  • Use the “json.Encoder” and “json.Decoder” types

  • Outlook on other data encoding libraries (YAML, XML, and others)

Encoding and Decoding from Streams
03:20

This video shows how to circumvent Go’s automatic JSON encoding using manual encoding and decoding (and when this is useful).

  • Introduce the “json.Marshaler” and “json.Unmarshaler” interfaces

  • Practical use case: Marshaling

  • Practical use case: Unmarshaling

Building Custom (Un)Marshalers
04:21

This video shows how to use Go’s JSON decoder in a non-typesafe way and explains when this might be necessary.

  • Explain when it might be necessary to decode into an interface{} value

  • Explain how to do that

  • Show common pitfalls and caveats

Unmarshaling into Interface{} Values
04:27

There are many open-source JSON libraries that can be used as an alternative to Go’s built-in library. This video shows some of them and explains their advantages.

  • Use cases for alternative JSON libraries

  • Using the “EasyJSON” library

  • Use the “Jason” library

Alternative JSON Libraries
06:06

Defining JSON types is often time-consuming and error prone. This video shows how to use a tool to automate this.

  • Introduce GoJSON

  • Show how to use GoJSON

Generate JSON Types Automatically
02:24

Unit Tests are used to automatically test individual units of code for functionality. This video explains how to write and execute them.

  • What are Unit Tests?

  • Write and execute Tests

  • Assertions made easy

Unit Testing in Go
04:51

Unit test coverage is an important metric to assert how much of your code is covered by tests. This video explains how to measure it.

  • What is Test Coverage?

  • Run tests with coverage measurement

  • Create a graphical evaluation of test coverage

Measuring Test Coverage
03:45

Mocks are a common way to test units of a program in isolation. This video shows how to create them and introduces libraries to make mocking easier.

  • Understand mocking

  • How to mock an interface?

  • Create mocks automatically with mockgen

Using Mocks in Unit Tests
06:09

The CPU profiler is a useful tool to determine which part of your program uses how much CPU time. This video explains how to integrate it into your program and how to interpret the results.

  • How to integrate the CPU profiler into your program?

  • Create a CPU profile

  • Analyze and interpret a CPU profile

Using the CPU Profiler
04:05

Just as the CPU profiler, the memory profiler is a useful tool to determine how much memory is allocated by which parts of your program. This video explains how to integrate it into your program and how to interpret the results.

  • How to integrate the memory profiler into your program?

  • Create a memory profile

  • Analyze and interpret a memory profile

Finding and Plugging Memory Leaks
03:38

A debugger is a good tool to have when things aren’t going your way. This video introduces the Delve debugger and shows how to use it.

  • Purpose of a Debugger

  • Use Delve on the command-line

  • Use Delve in VS code

How to Use the Delve Debugger?
07:11

Gofmt introduces a common coding standard for Go that can be enforced with a simple tool. This video shows how to use it.

  • What are coding standards?

  • Difference between “gofmt” and “go fmt”

  • Use gofmt

Consistent Formatting with gofmt
04:28

This video shows how to use Govet – a useful tool to find common coding errors in your program.

  • What is govet?

  • How to use govet?

  • What does govet check for?

Finding Common Errors with govet
02:42

Golint is a tool to check for common stylistic errors in Go code. This video shows how to use it.

  • What is golint?

  • How to use golint?

  • What does golint check for?

Checking Code Style with golint
02:43

The cyclomatic complexity is a useful metric to measure how complicated individual units of your program are. This video shows how to measure it.

  • Define cyclomatic complexity

  • How to use gocyclo?

  • Recommendations on how to handle complexity

Testing Complexity with gocyclo
03:34

Go’s error handling by passing errors as return values is unique; however, forgetting to check for returned errors is a common rookie mistake. This video introduces errcheck, a tool that automatically checks for unchecked errors.

  • Recap: Error handling in Go

  • How to use errcheck?

Find Unchecked Errors with errcheck
01:59

This video introduces gosec, a tool to automatically find common security issues in a Go program.

  • How to use gosec?

  • What does gosec check for?

  • Recommendation concerning reliance on tools for security

Find Security Issues with gosec
02:52

Go modules are a new standard introduced in Go 1.11 to manage dependencies across packages. This video shows how to use them.

  • History of the $GOPATH and vendoring

  • Intro in Go modules

  • Using Go modules

Managing Dependencies with Go Modules
04:31

When distributing your software for other operating systems and platforms, you’ll have to cross-compile your application. This video shows to cross-compile using the Go compiler.

  • Use $GOOS and $GOARCH

  • Use build constraints

Cross-Compiling for Other Operating Systems
02:55

Container images are a common way of deploying software. In this video, you’ll learn how to build a minimal Docker image for your Go binary.

  • Structure of a container image

  • Build your application with a multi-stage build

  • Package a container image based on the “scratch” image

Building Minimal Docker Images Using the “scratch” Base Image
04:17

Releasing software is complicated, especially when targeting multiple operating systems and deployment mechanisms. This video shows how to use GoReleaser, which can automate building your application for multiple targets at once.

  • A typical release process

  • Introduce GoReleaser

  • Practical example on how to use GoReleaser

Automate Releases Using GoReleaser
06:03

This video combines many of the tools shown in the previous video and demonstrates how to build a complete CI pipeline for a Go project.

  • Parts of a CI pipeline

  • Build a CI pipeline for GitLab CI

  • Show everything in action

Building a CI/CD Pipeline for a Go Project
08:14
Test your knowledge
5 questions
+ Troubleshooting Go Application Development
42 lectures 01:42:15

This course gives glimpse of the entire course.

Preview 05:50

In this video, you’ll learn about the syntax error that is unexpected literal and expecting type.

  • Write a program that will cause a compiler error

  • Fix the program so that it compiles

Unexpected Literal, Expecting Type
01:05

In this video, you’ll see about an another syntax error which is unexpected newline, expecting comma or }

  • Create a multi-line statement with a syntax error

  • Fix the error

  • Show an alternative solution

Unexpected Newline, Expecting Comma or }
01:55

In this video, you’ll see that how no new variables can be written on the left side of :=

  • Demonstrate short variable declaration

  • Show when it is not allowed

No New Variables on Left Side Of :=
01:45

In this video, you’ll learn how a multiple value can be returned in a single value context.

  • Demonstrate problem using a function with multiple return values

  • Show how to correct the issue

Multiple-Value in Single-Value Context
01:09

In this video, you’re going to look at undefined fmt library.

  • Write a program that uses a non-imported library

  • Fix using goimports tool

Undefined: fmt
00:46

In this video, you’ll learn the error which is main block is declared in this block.

  • Create a multi-file program to demonstrate error

  • Show how to compile a subset of files

Main Redeclared in This Block
01:53

In this video, you’ll learn to declare the variable which is not used.

  • Demonstrate sample program and compiler error

  • Fix the problem by deleting the unused variable

Declared and Not Used
00:55

In this video, you’re going to learn about the importing the packages.

  • Demonstrate sample program and compiler error

  • Fix the problem by deleting the unused import

Imported and Not Used
00:48

In this video, you’ll learn about the deadlocks.

  • Create a deadlock by a naive use of concurrency

  • Fix using a channel

  • Demonstrate the importance of closing channels

Deadlocks
02:13

In this video, you’re going to discuss about the missing outputs from go routines.

  • Create a goroutine which does some work outside of main()

  • Demonstrate how it can be pre-empted by the termination of main()

  • Fix using a WaitGroup

Missing Output from Goroutine
02:06

In this video, you’ll learn about the variable used by deferred function.

  • Use a function-scoped variable in a deferred function call

  • Prove that the value is not as expected

  • Show how to fix using a pointer

Variable Used by a Deferred Function
02:09

In this video, you’ll learn what gotchas to do with waitgroups is.

  • Create a concurrent application

  • Fix the application's unexpected output with a WaitGroup

  • Demonstrate the importance of using a pointer for a WaitGroup

Wait Groups
02:19

In this video, you’ll learn about the no installation path in GOPATH.

  • Write a functioning program outside of GOPATH and attempt to install it

  • Demonstrate proper use of GOPATH for storing and installing code

  • Show how to add bin folder to PATH for easy execution of Go programs

No Install Location Outside GOPATH
02:14

n this video, you’ll discuss about not finding a package in any of error.

  • Write a valid program that uses an unmet dependency

  • Install dependency and execute the program

Cannot Find Package in Any Of
01:09

In this video, you’ll look a one of the pitfalls overlying in somebody’s code. This is when you depend on it and they make changes in package.

  • Create a valid program that uses an external dependency

  • Change the dependency in a backwards-incompatible way

  • Update the code to work with the updated package

Upstream Changes
01:34

In this video, you’ll learn about the dependencies that you use in cgo functionalities.

  • Show how packages can fail to download and install when they have C requirements

  • Show how packages can install and build but still fail to run

Dependencies Using cgo
02:10

These are things won’t necessarily cause the program to fail a complier-fail to run but they may run without errors and give output which you wouldn’t expect. So, let’s study the zero value for non-existent map keys.

  • Show surprising behaviour when requesting non-existent keys from a map

  • Demonstrate how to check for and handle these occurrences

Zero Value for Non-Existent Map Keys
01:50

In this video, you’ll learn about the syntax errors which are used as value.

  • Write code where the function and caller don't agree on the return values

  • Explain and fix

Syntax Error: _, i := nums Used as Value
00:58

In this video, you’ll look at copy argument order.

  • Create a slice and copy the values the "obvious" way

  • Show the proper way to do it

Copy Argument Order Is Not Intuitive
01:19

In this video, you’ll learn about breaking with a select block.

  • Show gotcha when combining select and for blocks

  • Introduce labels as a solution

Using Break with a Select Block
02:26

In this video, you’ll learn about using a range with a slice return the index as the first argument.

  • Demonstrate automatic index variable and common misstep

  • Show correct usage

Using Range with a Slice Returns the Index as the First Argument
01:17

In this video, you’ll learn about the non-exported types which do not marshal to JSON.

  • Demonstrate JSON marshalling functionality with common mistake

  • Remedy the problem incrementally, further illustrating its cause

Un-Exported Types Do Not Marshal to JSON
01:34

In this video, you’ll learn that maps are not thread safe.

  • Demonstrate simple code which will panic under some (but not all) conditions

  • Show proper usage of a map in a concurrent program

The Map Type Is Not Thread Safe
01:27

In this video, you’ll learn about unexpected results using variables in Goroutine.

  • Demonstrate obvious (and wrong) use of variables in Goroutines, and the consequences

  • Show proper method for providing variables to Goroutines

Unexpected Results Using Variables in Goroutine
01:28

In this video, you’ll learn how to not panic in go.

  • Show the usage of panic

  • Explain why it should never be used

Don’t Panic
02:21

In this video, you’ll see about the errors which can’t be ignored in go.

  • Show the danger of ignoring errors

  • Demonstrate proper handling of errors

Don’t Ignore Errors
03:10

In this video, you’ll use backticks for string literals to avoid excessive quoting.

  • Demonstrate problems when using quotation marks in strings

  • Show a workaround with escaping

  • Show a better solution using string literals

Using Backticks for String Literals to Avoid Excessive Quoting
03:58

In this video, you’ll learn about the Map into a set.

  • Use a map as a counter

  • Use a map as a set

Making a Map into a Set
02:16

In this video, you’ll learn how not to use mutable global variables.

  • Show how convenient global variables are

  • Show why mutable global variables are a mistake

Do Not Use Mutable Global Variables
03:14

In this video, you’ll learn about the index errors.

  • Demonstrate a major cause of runtime errors

  • Show the simple way to prevent them

Index Errors
03:07

In this video, you’ll learn about the nil point errors.

  • Demonstrate what is probably the single largest cause of runtime panics

  • Show how to avoid them

Nil Pointer Errors
02:53

In this video, you’ll learn about the memory leaks in go.

  • Create a memory leak in a simple application and demonstrate the effects

  • Explain what to look for to prevent and diagnose memory leaks

Memory Leaks
04:40

In this video, you’ll fail to check type assertion success.

  • Show the convenience and power of type assertions

  • Demonstrate the danger of laziness when using type assertions

Failing to Check Type Assertion Success
03:41

In this video, you’ll learn about the difference between concrete types versus dynamic types.

  • Demonstrate common use of concrete types

  • Make code more flexible using dynamic types

  • Use type assertions to remove limitations of dynamic types

Concrete Type Versus Dynamic Type
05:06

In this video, you’ll learn about the does not Implement method.

  • Demonstrate common error when using interfaces

  • Explain solution and how to avoid bloated interfaces

Does Not Implement – Method
03:49

In this video, you’ll learn about does not implement pointer.

  • Show limitations of using non-pointer receivers

  • Show power of a pointer receiver

  • Demonstrate solution to common compile-time error

Does Not Implement – Pointer
02:27

In this video, you’ll learn about the mixing constants and types.

  • Show how constants and variables are interchangeable

  • Show how constants and variables are not interchangeable

Mixing Constants and Types
03:07

In this video, you’ll learn about the variable shadowing in go.

  • Explain and demonstrate variable shadowing

  • Show scope of shadowing and consequences

  • Explain interaction between shadowing and short variable declaration

Variable Shadowing
03:06

In this video, you’ll learn about the time and duration of go.

  • Compare Go's time handling with other languages

  • Explain string formatting syntax

  • Demonstrate addition methods of the time package

time.Duration
04:11

In this video, you’ll learn about the converting between integers to strings.

  • Demonstrate the pitfall of attempting to cast an integer as a string

  • Show multiple ways to convert strings to numeric types

Converting Between Integers to Strings
03:10

In this video, you’ll learn about iterating over strings.

  • Demonstrate the convenience of Go's code being in UTF-8

  • Show proper iteration over UTF-8 strings

  • Show how to fix UTF-8 strings mangled by other programs

Iterating over Strings
03:40
Test your knowledge
5 questions
Requirements
  • To take up this Learning Path, you will be required to have some prior knowledge with Go programming. Any developers willing to master Go programming to develop robust and resilient apps will feel perfectly comfortable in understanding the topics presented.
Description

A Learning Path is a specially tailored course that brings together two or more different topics that lead you to achieve an end goal. Much thought goes into the selection of the assets for a Learning Path, and this is done through a complete understanding of the requirements to achieve a goal.

Go is a multi-paradigm programming language that has built-in facilities to simplify the development of modern applications. You can create concurrent applications and it is particularly useful in developing cloud-native applications as it’s convenient, occupies a low footprint, and deploys fast.

This Learning Path is architected to teach you interesting tools, frameworks, and techniques that you can use to leverage the benefits of working with Go to develop your applications. You will begin to get familiar with the tools to build web applications, microservices, command-line applications, and much more. Once you are comfortable with developing your apps, you will then learn some amazing tips, tricks & techniques to improve the code quality of your projects. Moving further, you will learn to troubleshoot your Go application to prevent crashes in production by remembering just a few simple techniques and effortlessly surmount the hurdles and become more productive quickly, writing fast, and stable code.

By the end, you will have gained a solid foundation of Go as well as the skills to make your applications more robust and resilient.

Author Bios

  • Tarik Guney has been working as a software engineer for more than 10 years in the industry, in various domains including finance, education, and public safety. He is currently working as a principal software engineer for Motorola Solutions. His passion for programming and his years of experience in the industry always lead him to explore new technologies, using them in real-world scenarios, and helping others. Besides his videos about Go Programming, he has recorded hours of videos about various other IT topics.

  • Theofanis Despoudis is a Senior Level Software Engineer at Teckro. He is an accomplished and accountable Software Developer with a consistent record of achievements in the successful end-to-end delivery of leading-edge projects and products. He has an interest in Linux as an Operating System and also got practical working experience with it. (He has worked with Debian, Ubuntu, Fedora, and a little bit of Red Hat).

  • Martin Helmich studied computer science at the University of Applied Sciences in Osnabrück and lives in Rahden, Germany. He works as a software architect, specializing in building distributed applications using web technologies and Microservice Architectures. Besides programming in Go, PHP, Python, and Node.js, he also builds infrastructures using configuration management tools such as SaltStack and container technologies such as Docker and Kubernetes.

  • Shawn Milochik has been programming for over 20 years and has used Go since 2014. In addition to coding, and mentoring coders, he enjoys teaching, studying music theory, and podcasting. He's currently working as a Cloud Engineering Manager at Teltech Systems, Inc.

Who this course is for:
  • This course targets application developers, beginner-level developers in the Go programming language, front-end developers, software developers,, and web developers. They are very keen on building applications with Go and want to learn some useful, interesting ways to further improve their Go programming skills in a much more unique and easy way. Even if you are experiencing with Go, you’ll surely learn a thing or two from this course.