Hands-on Go Programming

Download Full Version of the eBook "Hands-on Go Programming"

Hands-on Go Programming: Learn Google’s Golang Programming, Data Structures, Error Handling and Concurrency by Sachchidanand Singh

Download - Hands-on Go Programming: Learn Google’s Golang Programming, Data Structures, Error Handling and Concurrency by Sachchidanand Singh - ePUB 

Golang is regarded as a swift and flawless programming language having loads of useful features like efficient built-in concurrency, garbage collector with automatic garbage detection and cleaning, dynamic growable call stack of goroutines, extremely fast compiler and cross platform versatility, etc. A lot of cloud, networking, and DevOps softwares are written in Golang like Docker, Kubernetes, Terraform, etcd, and ist.io. The Go developers community is one of the most active open source communities on GitHub.


This book focuses on learning Golang, starting from the basic concepts to interfaces, pointers, concurrency, etc. We have explained each concept in detail using programming examples. We start with the basics and get into more complex stuff with each chapter. Each chapter has exercises which will help you in understanding the concepts clearly.


Over the 12 chapters in this book, you will learn the following:

Chapter 1: [Introduction]

This chapter covers the basic concepts of data types, constants, variables, operators, reassignment, and redeclaration. You will learn how to use them in the Go programming language.


Chapter 2: [Functions]

This chapter will cover the function declaration, parameters, multiple returns, variadic function, and defer statement. It will also cover the concept of call by value and how to pass the address of the variable as a value.


Chapter 3: [Control flows]

The objective of this chapter is to introduce the concepts of control flows and loops to the readers and show how to use them.


Chapter 4: [Arrays]

The objective of this chapter is to introduce the concept of arrays to the readers. It will also show how to declare and initialize arrays, and pass arrays to function.


Chapter 5: [Slices]

The objective of this chapter is to introduce the concept of slices to the readers and tell them how to declare slices, the various ways of creating slices, modifying and comparing slices, about multi-dimensional slices, sorting slices, and iterate over slices.


Chapter 6: [Maps]

This chapter explains the basic concept of map and how to use it in the Go programming language. It covers how to declare and initialize a map, iterate over a map, how to perform retrieve, update, and delete over the map, and how to check if a key exists in a map, etc.


Chapter 7: [Structs]

This chapter explains the basic concept of struct and how to use it in the Go programming language. It covers how to declare and initialize structs type, access fields of structs, pointer to structs, exported and unexported structs, and structs fields.


Chapter 8: [Methods]

This chapter covers the concept of methods in the Go programming language. You will learn how to declare a method, how to call a method, the syntax of different types of methods, and the method resolution process.


Chapter 9: [Interfaces]

This chapter will cover the concept of interface in Golang. You will learn what the interface in Golang is, how Golang interfaces are different from other languages, how to declare an interface, and how implicit implementation happens in Golang and what are its benefits. We will create the interface without methods and see its benefits with built-in functions. We will see the impact of value receiver and pointer receiver while implementing the interface and creating polymorphic objects.


Chapter 10: [Pointers]

In this chapter, you will learn what pointers in Golang are. This chapter will explain to you the use of pointers, how to declare a pointer variable, and you will understand the pointer types. You will also learn why arithmetic operations are not allowed on pointer variables in Golang.


Chapter 11: [Concurrency]

This chapter will cover goroutines and channels. You will learn how to define a goroutine, what WaitGroup is, and how to use the WaitGroup to wait for other goroutines to finish. You will understand the concept of channel. We will use the channel for communication between the goroutines. We will create two types of goroutines: buffered and unbuffered.


Chapter 12: [Error handling]

This chapter will cover error handling. At the end of this chapter, you will learn what an error in Golang is, how to return an error from a function or method, and how to handle these errors in the caller function. We will also see a built-in error interface, the error packages and the method, function, and struct in the errors package. You will learn how to define a new error, create a customized error type, what panic is, how to handle panic using recover, what defer is, and the importance of the defer function while handling panic, etc.


36
Views
0
Likes

Licenses:

  • CC BY-NC-SA 3.0 PH
  • The author's reference is not required

Share on networks

eBooks Details:

Comments (0) Add

Кликните на изображение чтобы обновить код, если он неразборчив
No comments yet. Your comment will be the first!