Beginning Go Programming

Build Reliable and Efficient Applications with Go

Af Rumeel Hussain, Maryam Zulfiqar
Detaljer Apress L. P.
ISBN 9781484288573
Sprog Engelsk
Vælg mellem
Pris 291,00 kr.
Paperback

Ikke på lager

Print on demand. Leveringstid vil være ca 2-3 uger.

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.
Beginning Go Programming 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.   After reading this book and working through its practical examples, you will be ready to begin programming your own Go-based applications.
What You Will Learn
  • Understand the fundamentals of the Go programming language
  • Master the different features of Go and how to implement real-life scenarios using the language
  • Work with text in Go, such as string formatting and Unicode data handling
  • Work with HTTP in Go

Who This Book Is For Programmers and developers looking to learn Go programming language concepts for efficient application building. 


Chapter 1: Introduction to Go
Chapter Goal: Provides an overview of the Go programming language in terms of its basic features. No of pages: Sub -Topics: Is GoLang Static-Typed or Compiled? Is Go Object-Oriented? Features that make Go lang the premium choice for programming Features excluded from Go lang Go programs
Chapter 2: Go Basics
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. No of pages: Sub - Topics Overview Ancestors of Go Go Syntax Installing Go Go playground Using IDE for developing Go applications Getting started with programming Go applications Hello world! Different parts of Go programs Executing Go program Keywords Variables Variable data types Naming conventions Declaring variables Taking user input Using scanf Using scanln Using bufio Math operators and packages The math package Dates and times Operator precedence in Go Memory management & reference values New vs make Incorrect memory allocation example Correct memory allocation example Memory deallocation Pointers Data Type What is a pointer Declaring pointers Comparison with Java and C-style languages Ordered values in arrays and slices Arrays in Go Declaring arrays Initialising arrays Accessing array elements Querying the size of array Multi-dimensional arrays [not included yet] Slices in Go Defining a slice The len() and cap() functions Nil slice Sub-slicing append() and copy() functions Sorting slices Maps Defining maps Adding entries in a map object Deleting entries from a map object Iterating over stored values in a map object Structs Data Type Defining a struct Accessing structure members Structures as function arguments Pointers to structures Program flow If statement Switch statement For statement Goto statement Functions Defining a function Calling a function Returning multiple values from Function Function arguments Methods Read/Write text files Write text files Read text files HTTP Package JSON Go Recipes: Basics programming fundamentals Overview Numbers and slice in Go Working with maps in Go Go error handling Defer and panic recovery Hands-On challenge
Chapter 3: Working with Text
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. No of pages: Sub -Topics Go String formatting and working with unicode Case insensitive comparisons in Go Regular expressions and reading text files with Go Hands-On challenge
Chapter 4: Structs, Methods, and Interfaces
Chapter Goal: In this
chapter, we will provide exercise related to the usage of structs, methods, and interfaces. No of pages: Sub -Topics: Overview Go structs, methods and interfaces Structs Methods Interfaces Empty interface and working with iota in Go JSON Encoding/Decoding Generics Hands-on challenge
Chapter 5: Working with JSON
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. No of pages: Sub -Topics: Overview Unmarshalling JSON with GO Parsing complex JSON with Go Marshalling JSON with Go Dealing with zero and missing values in Go Using mapstructure to handle arbitrary JSON
Chapter 6: HTTP
Chapter Goal: In this
chapter, we cover on how to work with HTTP in Go language. No of pages: Sub -Topics Overview HTTP calls in Go Authentication and Writing an HTTP server in Go REST with gorilla/mux Hands-on challenge
Chapter 7: Concurrency
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. No of pages: Sub -Topics Understanding goroutines Converting sequential code to concurrent in Go Using Goroutines with shared resources Seeing how shared resources impact goroutines Accessing shared resources using mutual exclusion Using atomic counters for modifying shared resources Synchronizing Goroutines Timeouts in Go sync.WaitGroup and sync.Once Using a pool of goroutines sync/atomic Hands-on Challenge
Chapter 8: Tips & Tricks
Chapter Goal: this
chapter we cover different tips and tricks related to the Go language. No of pages: Sub -Topics Alternate ways to import packages goimports Organization Custom constructors Breaking down code into packages Sets Dependency package management Using errors Quick look at some compiler''s optimizations Set the build id using git''s SHA How to see what packages my app imports Iota: Elegant Constants Auto Increment Custom Types