Complete Guide to Application Development with Go
- 9.5 hours on-demand video
- 1 downloadable resource
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- 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.
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
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
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
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”
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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.
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
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)
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
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
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?
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
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
Practical example on how to use GoReleaser
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
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
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
- 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.
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.
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.
- 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.