Details

Beginning Go Programming


Beginning Go Programming

Build Reliable and Efficient Applications with Go

von: Rumeel Hussain, Maryam Zulfiqar

36,99 €

Verlag: Apress
Format: PDF
Veröffentl.: 22.11.2022
ISBN/EAN: 9781484288580
Sprache: englisch

Dieses eBook enthält ein Wasserzeichen.

Beschreibungen

Understand and write programs in Go, a multi-paradigm language with built-in features for concurrent programming. This book enables developers to build software that is simple, reliable, and efficient. It'll also help beginners to start programming Go-based applications.<div><br><div><i>Beginning Go Programming</i> begins by explaining the programming fundamentals of the Go language, including basic syntax, data type and structures, and the use of functions and methods. Next, it covers string formatting, Unicode data handling, and how to use regular expressions in Go. Further, it discusses how to encode and decode JSON formatted data for Go applications, and how to work with HTTP in Go. It concludes by exploring concurrency and covering the most powerful features of Go, as well as tips and tricks related to it.</div><div>&nbsp;</div><div>After reading this book and working through its practical examples, you will be ready to begin programming your own Go-based applications.</div><div><br></div><div><b>What You Will Learn</b></div><div><div><ul><li><div>Understand the fundamentals of the Go programming language</div></li><li><div>Master the different features of Go and how to implement real-life scenarios using the language</div></li><li><div>Work with text in Go, such as string formatting and Unicode data handling</div></li><li><div>Work with HTTP in Go</div></li></ul></div><div><br></div><div><b>Who This Book Is For</b></div><div>Programmers and developers looking to learn Go programming language concepts for efficient application building.&nbsp;</div></div></div>
Chapter 1:&nbsp; Introduction to Go<div>Chapter Goal: Provides an overview of the Go programming language in terms of its basic features.</div><div>No of pages: </div><div>Sub -Topics:</div><div>● Is GoLang Static-Typed or Compiled?</div><div>● Is Go Object-Oriented?</div><div>● Features that make Go lang the premium choice for programming</div><div>● Features excluded from Go lang</div><div>● Go programs</div><div><br></div><div>Chapter 2:&nbsp; Go Basics</div><div>Chapter Goal: This chapter is intended to cover the programming fundamentals of the Go programming language. Covering basic syntax, program structure, data types, data structures, statements, functions, I/O from files, concurrency, and error handling.</div><div>No of pages:</div><div>Sub - Topics </div><div>○ Overview</div><div>■ Ancestors of Go&nbsp;</div><div>○ Go Syntax</div>○ Installing Go<div>○ Go playground&nbsp;</div><div>○ Using IDE for developing Go applications</div><div>○ Getting started with programming Go applications</div><div>■ Hello world!</div><div>■ Different parts of Go programs</div><div>■ Executing Go program</div><div>■ Keywords</div><div>○ Variables</div><div>■ Variable data types</div><div>■ Naming conventions</div><div>■ Declaring variables</div><div>■ Taking user input</div><div>● Using scanf</div><div>● Using scanln</div><div>● Using bufio</div><div>■ Math operators and packages</div><div>● The math package</div>● Dates and times<div>● Operator precedence in Go</div><div>○ Memory management & reference values</div><div>■ New vs make</div><div>● Incorrect memory allocation example</div><div>● Correct memory allocation example</div><div>■ Memory deallocation</div><div>○ Pointers Data Type</div><div>■ What is a pointer</div><div>■ Declaring pointers</div><div>■ Comparison with Java and C-style languages</div><div>○ Ordered values in arrays and slices</div><div>■ Arrays in Go</div><div>● Declaring arrays&nbsp;</div><div>● Initialising arrays</div><div>● Accessing array elements</div><div>● Querying the size of array</div><div>● Multi-dimensional arrays [not included yet]</div><div>■ Slices in Go</div><div>● Defining a slice</div><div>● The len() and cap() functions</div><div>● Nil slice</div><div>● Sub-slicing</div><div>● append() and copy() functions</div><div>● Sorting slices</div><div>○ Maps</div><div>■ Defining maps</div><div>■ Adding entries in a map object</div><div>■ Deleting entries from a map object</div><div>■ Iterating over stored values in a map object</div><div>■ </div><div>○ Structs Data Type</div><div>■ Defining a struct</div><div>■ Accessing structure members</div><div>■ Structures as function arguments</div><div>■ Pointers to structures</div><div>○ Program flow</div><div>■ If statement</div><div>■ Switch statement</div><div>■ For statement</div><div>■ Goto statement</div><div>○ Functions</div><div>■ Defining a function</div><div>■ Calling a function&nbsp;</div><div>■ Returning multiple values from Function</div><div>■ Function arguments</div><div>■ Methods</div><div>○ Read/Write text files</div><div>■ Write text files</div><div>■ Read text files</div><div>○ HTTP Package</div><div>○ JSON</div><div>○ Go Recipes: Basics programming fundamentals</div><div>■ Overview</div><div>■ Numbers and slice in Go</div><div>■ Working with maps in Go</div><div>■ Go error handling</div><div>■ Defer and panic recovery</div><div>○ Hands-On challenge</div><div><br></div>Chapter 3: Working with Text<div>Chapter Goal: In this chapter, we will discuss how to work with text in Go language. Specifically, we will cover the string formatting, Unicode data handling, and how to use regular expressions in Go language.</div><div>No of pages:&nbsp; &nbsp;&nbsp;</div><div>Sub -Topics</div><div>● Go String formatting and working with unicode</div><div>● Case insensitive comparisons in Go</div><div>● Regular expressions and reading text files with Go</div><div>● Hands-On challenge</div><div><br></div><div>Chapter 4: Structs, Methods, and Interfaces</div><div>Chapter Goal:&nbsp; In this chapter, we will provide exercise related to the usage of structs, methods, and interfaces.</div><div>No of pages:&nbsp; &nbsp;&nbsp;</div><div>Sub -Topics:</div><div>● Overview</div><div>● Go structs, methods and interfaces</div><div>○ Structs</div><div>○ Methods</div><div>○ Interfaces</div><div>● Empty interface and working with iota in Go</div><div>○ JSON Encoding/Decoding</div><div>○ Generics</div><div>● Hands-on challenge</div><div><br></div><div>Chapter 5: Working with JSON</div><div>Chapter Goal: In this chapter, we will discuss working with JSON, especially, how to encode and decode the JSON formatted data for use in Go applications.&nbsp;</div><div>No of pages:&nbsp; &nbsp;&nbsp;</div><div>Sub -Topics:</div><div>● Overview</div><div>● Unmarshalling JSON with GO</div><div>● Parsing complex JSON with Go</div>● Marshalling JSON with Go<div>● Dealing with zero and missing values in Go</div><div>● Using mapstructure to handle arbitrary JSON</div><div><br></div><div>Chapter 6: HTTP</div><div>Chapter Goal: In this chapter, we cover on how to work with HTTP in Go language.&nbsp;</div>No of pages:&nbsp; &nbsp;&nbsp;<div>Sub -Topics</div><div>● Overview</div><div>● HTTP calls in Go</div><div>● Authentication and Writing an HTTP server in Go</div><div>● REST with gorilla/mux</div><div>● Hands-on challenge</div><div><br></div><div>Chapter 7: Concurrency</div><div>Chapter Goal: Go has rich support for concurrency using goroutines and channels. In this chapter, we discuss the most powerful feature of the Go Language, i.e., concurrency.</div><div>No of pages:&nbsp; &nbsp;&nbsp;</div><div>Sub -Topics</div><div>● Understanding goroutines&nbsp;</div><div>○ Converting sequential code to concurrent in Go</div><div>● Using Goroutines with shared resources</div><div>○ Seeing how shared resources impact goroutines</div><div>○ Accessing shared resources using mutual exclusion&nbsp;</div><div>○ Using atomic counters for modifying shared resources</div><div>● Synchronizing Goroutines</div><div>○ Timeouts in Go</div><div>○ sync.WaitGroup and sync.Once</div><div>○ Using a pool of goroutines</div><div>○ sync/atomic</div><div>● Hands-on Challenge</div><div><br></div><div>Chapter 8: Tips & Tricks</div><div>Chapter Goal: this chapter we cover different tips and tricks related to the Go language.</div><div>No of pages:&nbsp; &nbsp;&nbsp;</div><div>Sub -Topics</div><div>● Alternate ways to import packages</div>○ goimports<div>○ Organization&nbsp;</div><div>● Custom constructors</div><div>● Breaking down code into packages</div><div>● Sets</div><div>● Dependency package management</div>● Using errors<div>● Quick look at some compiler’s optimizations</div><div>● Set the build id using git’s SHA</div><div>● How to see what packages my app imports</div><div>● Iota: Elegant Constants</div><div>○ Auto Increment</div><div>○ Custom Types</div><div><br></div>
<div><p><b>Rumeel Hussain</b>, has a Bachelors Degree in Computer Science and is presently working as a Senior Blockchain Developer and Senior Tech Evangelist at BNB Chain (UAE), supporting the development and growth of the ecosystem. He is an information technology enthusiast with more than five years of experience leading and implementing blockchain applications and architectures, analyzing and refactoring modern programming languages like Go, troubleshooting cloud infrastructure, and assessing security risks. His current work is focused on leveraging blockchain technology and crypto to achieve the full potential of Web3 applications.</p>

<b>Maryam Zulfiqar </b>has four years of research experience and&nbsp;has a Masters Degree in Computer Science. She is currently working as a Tech Martian in BNB Chain (Pakistan Region). She also works as a Senior Researcher and Developer. She is passionate about developer education, especially in sharing her knowledge on topics that are "the talk of the town" in the technology field. She has also worked in the capacity of researcher and team lead roles for HEC-funded projects targeted at community growth and welfare.<br></div><div><br></div>
Understand and write programs in Go, a multi-paradigm language with built-in features for concurrent programming. This book enables developers to build software that is simple, reliable, and efficient. It'll also help beginners to start programming Go-based applications.<div><br><div><i>Beginning Go Programming</i>&nbsp;begins by explaining the programming fundamentals of the Go language, including basic syntax, data type and structures, and the use of functions and methods. Next, it covers string formatting, Unicode data handling, and how to use regular expressions in Go. Further, it discusses how to encode and decode JSON formatted data for Go applications, and how to work with HTTP in Go. It concludes by exploring concurrency and covering the most powerful features of Go, as well as tips and tricks related to it.</div><div>&nbsp;</div><div>After reading this book and working through its practical examples, you will be ready to begin programming your own Go-based applications.</div><div><br></div><div>You will:</div><div><ul><li>Understand the fundamentals of the Go programming language</li><li>Master the different features of Go and how to implement real-life scenarios using the language</li><li>Work with text in Go, such as string formatting and Unicode data handling</li><li>Work with HTTP in Go</li></ul></div></div>
<p>Explains how to encode and decode the JSON formatted data for use in Go applications</p><p>Explains implementation of concurrent programming in Go language </p><p>Covers authentication and writing an HTTP server in Go language</p>